The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘JavaScript/ECMAScript’ Category

pascal.js

Posted by jpluimers on 2025/10/22

Because it is cool: interactive [Wayback/Archive] pascal.js that shows the intermediate steps:

  1. Turbo Pascal 1.0-ish code
  2. Abstract Syntax Tree (in JSON notation)
  3. LLVM IR (intermediate representation)
  4. Emscripten compiled JavaScript
  5. Console output (stdout)

Source is at GitHub: [Wayback/Archive] GitHub – kanaka/pascal.js: Pascal compiler implemented in JavaScript

Via: [Wayback/Archive] javascript pascal at DuckDuckGo

--jeroen

Posted in Development, JavaScript/ECMAScript, Pascal, Scripting, Software Development, Turbo Pascal | Leave a Comment »

Jeroen Wiert Pluimers @wiert@mastodon.social on X: “@_ObomheseR Since JavaScript is in the group of curly based programming languages influenced by the B programming language, integer constants starting with zero are tried first in octal base. 017 octal is 15 decimal 018 octal is not possible, so becomes 18.”

Posted by jpluimers on 2025/08/20

With the constant influx of JavaScript programmers, it keeps worth repeating that you should always run JavaScript in strict mode via "use strict"; (like in the past Visual Basic 6 developers should use option strict and option explicit) to forget risky JavaScript syntax like implicit ocal constants (which were removed from the documentation in the 2009 ECMAScript 5 specification for JavaScript), and every codeline should have a test code covering it, especially for comparisons involving non-strict behaviour like the use of leading zeros.

As of the succeeding 2015 standard (ECMAScript 6), octal numbers in JavaScript start with 0o or 0O followed by a series of octal digits.

Oh, and the history of octal in computing of course has to do with 6-bit systems and also lead to 6-six bit character codes including BCD character encoding..

My tweet back earlier this year: [WaybackSave/Archive] Jeroen Wiert Pluimers @wiert@mastodon.social on X: “@_ObomheseR Since JavaScript is in the group of curly based programming languages influenced by the B programming language, integer constants starting with zero are tried first in octal base. 017 octal is 15 decimal 018 octal is not possible, so becomes 18.”

Inhteritence:

Read the rest of this entry »

Posted in B, BASIC, C, Development, JavaScript/ECMAScript, MarkDown, Retrocomputing, Scripting, Software Development, VB6, Visual BASIC | Leave a Comment »

linux – Get final URL after curl is redirected – Stack Overflow (plus some Twitter scraping tricks)

Posted by jpluimers on 2025/08/06

Sometimes I need [Wayback/Archive] Redirect Checker | Check your Statuscode 301 vs 302 on the command-line, so cURL to the rescue: [Wayback/Archive] linux – Get final URL after curl is redirected – Stack Overflow. The relevant portions of answers and comments further below.

TL;DR:

Since I prefer verbose command-line arguments (you can find them at the [Wayback/Archive] curl – How To Use on-line man page) especially in scripts this HTTP GET request is what works with Twitter:

% curl --location --silent --output /dev/null --write-out "%{url_effective}\n" https://twitter.com/anyuser/status/20
https://x.com/anyuser/status/20

This failed (twitter dislikes HTTP HEAD requests):

% curl --head --location --silent --output /dev/null --write-out "%{url_effective}\n" https://twitter.com/anyuser/status/20
https://twitter.com/anyuser/status/20

Notes

Given so many of my scripts now run on zsh, I added the new-line because of command line – Why does a cURL request return a percent sign (%) with every request in ZSH? – Stack Overflow. You can strip that bit.

Note that these do not perform client side redirects, so they do not return the ultimate originating URL https://x.com/jack/status/20 (which was the first ever Tweet on what was back then called twttr) as Twitter on the client-side overwrites window.location.href with the final URL. Similar behaviour for getting the Twitter user handle of a Twitter user ID, more on Twitter tricks below.

Tweet by TweetID trick via [Wayback/Archive] Accessing a tweet using only its ID (and without the Twitter API) – Bram.us.

Further reading (thanks [Wayback/Archive] vise, [Wayback/Archive] Daniel Stenberg, [Wayback/Archive] Ivan, [Wayback/Archive] AndrewF, [Wayback/Archive] Roger Campanera, and [Wayback/Archive] Dave Baird):

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, Batch-Files, Bookmarklet, Communications Development, Conference Topics, Conferences, CSS, cURL, Development, Event, HTTP, Internet protocol suite, JavaScript/ECMAScript, Power User, Scripting, SocialMedia, Software Development, TCP, Twitter, Web Browsers, Web Development | Tagged: | Leave a Comment »

Tootski, a sharing bookmarklet for Mastodon · GitHub

Posted by jpluimers on 2025/08/05

For my research list: [Wayback/Archive] Tootski, a sharing bookmarklet for Mastodon · GitHub

--jeroen

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Mastodon, Power User, Scripting, SocialMedia, Software Development, Web Browsers | Leave a Comment »

Wakamai Fondue, the tool that answers the question “what can my font do?”

Posted by jpluimers on 2025/07/24

What Can my Font do - beta pageVery cool web site that I only discovered last year, with the clever name: [Wayback/Archive] Wakamai Fondue, the tool that answers the question “what can my font do?”

Drop a font!
Fonts aren’t uploaded,
they stay on your computer

Back then I used it to investigate some properties of SMuFL (Standard Music Font Layout) fonts as sometimes editing a PDF is easier than manually entering/transcribing it in MuseScore.

Of course you can use local font tools, but this is far easier for occasional use.

The beta can do even more at the risk of bumping into bugs: [Wayback/Archive] Wakamai Fondue, the tool that answers the question “what can my font do?”

Note the colour matching of the text around the circle with the fondue background image.

Oh: it is open source too, written mainly in JavaScript, CSS and a tiny bits of HTML and Python, based on Vue.js and npm, and available as parts in the repositories of [Wayback/Archive] Wakamai Fondue · GitHub:

Read the rest of this entry »

Posted in CSS, Development, Font, HTML, JavaScript/ECMAScript, npm, Python, Scripting, Software Development, Vue.js, Web Development | Leave a Comment »

Igor Brigadir posted a few useful Twitter search tips a while back: searching tweets, users, disable auto-URL, embedding media, etc

Posted by jpluimers on 2025/07/11

For my link archive:

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, SocialMedia, Software Development, Twitter, Web Browsers | Leave a Comment »

Alex’s Bookmarklets – New Twitter RSS Bookmarklet, Font Bookmarklet

Posted by jpluimers on 2025/07/09

Some entries for my inspiration: [Wayback/Archive] Alex’s Bookmarklets – New Twitter RSS Bookmarklet, Font Bookmarklet

–jeroen

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »

More database playground sites (similar to the dbfiddle and SQL Fiddle sites)

Posted by jpluimers on 2025/07/03

Almost 3 years ago, I wrote about some database/SQL fiddle sites in Database fiddle sites (which covers [Wayback/Archive] two different [Wayback/Archive] dbfiddle sites and the [Wayback/Archive] SQL Fiddle site).

In the meantime, I figured out that [Wayback/Archive] Toolbox for Developers has a few fiddle pages and database/SQL tools online (in their order, which is not alphabetical):

Read the rest of this entry »

Posted in Database Development, Development, JavaScript/ECMAScript, MariaDB, MongoDB, MySQL, NoSQL, PHP, PostgreSQL, Scripting, Software Development, SQL Server, SQLite, TypeScript | Leave a Comment »

Douglas Crockford – Google+ – on why comments got removed from JSON

Posted by jpluimers on 2025/07/01

Since this question keeps popping up around me every now and then, despite JSON being around for like 25 years now, this statement from the original designer Douglas Crockford:

[Wayback/Archive] Douglas Crockford – Google+ – Comments in JSON …

I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn’t.

Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.

Yup, Google+ has been dead for more than 6 years now, so it is important to quote these insights for posterity to find them back.

Related:

Via: [Wayback/Archive] Can comments be used in JSON? – Stack Overflow with several answers mentioning the above G+ post.

Query: [Wayback/Archive] json comment – Google Search

--jeroen

Posted in Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »

Some Mastodon servers allow themselves to be wrapped with the cuckoo.social to give a G+ (Google Plus) like user interface

Posted by jpluimers on 2025/07/01

[Wayback/Archive] Cuckoo+ is a wrapper around Mastodon that makes the UI look like Google+ (G+ / Google Plus).

It is open source at [Wayback/Archive] NanaMorse/Cuckoo.Plus: A GooglePlus-Like third-party web client for mastodon. with hardly any updates like lik because the author is not active on Mastodon any more according to [Wayback/Archive] Is dead the repo ? · Issue #237 · NanaMorse/Cuckoo.Plus (via [Wayback/Archive] Issues · NanaMorse/Cuckoo.Plus)

Note that in some Mastodon instances it fails because of CORS issues:

Read the rest of this entry »

Posted in Development, G+: GooglePlus, JavaScript/ECMAScript, Scripting, SocialMedia, Software Development, TypeScript, Web Development | Tagged: | Leave a Comment »