Archive for the ‘JavaScript/ECMAScript’ Category
Posted by jpluimers on 2021/03/25
A great way for testing REST JSON calls is using the [WayBack] JSONPlaceholder – Fake online REST API for developers:
Fake Online REST API for Testing and Prototyping
Serving ~200M requests per month
Powered by JSON Server [WayBack] + LowDB [WayBack]
It is like [WayBack] Placeholder.com: Placeholder Images Done For You [JPG, GIF & PNG] but for JSON and supports both CORS and JSON-P for cross domain requests.
You can either use that site (which has a predefined set of REST calls) or the basic [WayBack] My JSON Server – Fake online REST server for teams that allows you to respond it to a db.json file from github:
Fake Online REST server for teams

Create a JSON file on GitHub
github.com/user/repo/master/db.json
{
"posts": [
{
"id": 1,
"title": "hello"
}
],
"profile": {
"name": "typicode"
}
}
Get instantly a fake server
my-json-server.typicode.com/user/repo/posts/1
{
"id": 1,
"title": "hello"
}
Related
Documentation
There is basic documentation at the repository [WayBack] GitHub – typicode/jsonplaceholder: A simple online fake REST API server:
Read the rest of this entry »
Posted in Communications Development, Development, HTTP, Internet protocol suite, JavaScript/ECMAScript, JSON, REST, Scripting, Software Development, TCP | Leave a Comment »
Posted by jpluimers on 2021/03/10
TL;DR of https://css-tricks.com/debouncing-throttling-explained-examples/:
- debounce: Grouping a sudden burst of events (like keystrokes) into a single one.
- throttle: Guaranteeing a constant flow of executions every X milliseconds. Like checking every 200ms your scroll position to trigger a CSS animation.
- requestAnimationFrame: a throttle alternative. When your function recalculates and renders elements on screen and you want to guarantee smooth changes or animations. Note: no IE9 support.
Full article [WayBack] Debouncing and Throttling Explained Through Examples | CSS-Tricks
Delphi implementations:
–jeroen
Posted in Algorithms, Delphi, Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2021/02/09
For my archive: the [WayBack] How do I pretty-print JSON in Delphi? – Stack Overflow answer by [WayBack] Bob:
If you do not want to use any external library, and you’re using a Delphi XE5 or newer, there is a very handy TJson.Format() function in the REST.Json unit.
uses json, REST.Json;
{ ... }
function FormatJSON(json: String): String;
var
tmpJson: TJsonObject;
begin
tmpJson := TJSONObject.ParseJSONValue(json);
Result := TJson.Format(tmpJson);
FreeAndNil(tmpJson);
end;
–jeroen
Posted in Delphi, Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | 2 Comments »
Posted by jpluimers on 2020/12/16
On my list of things to try: [WayBack] Spinettaro’s Blog: Delphi Flux application architecture.
It is about a Delphi implementation of the Facebook Flux application architecture.
Related:
Via: [WayBack] Delphi Flux application architecture A good application architecture Finding a good application architecture is not easy, but defining an architecture f… – Daniele Spinetti – Google+
Note that by using the [WayBack] CodeRage 2018 Replay | Embarcadero Academy, you are disallowed using any of what you learn in a commercial way.
Embarcadero evangelists told the public that for the Community Edition, similar terms would not be upheld, but then the sales department started sending out nasty emails to people registering Community Edition using their work email address.
[WayBack] https://www.embarcaderoacademy.com/p/terms:
under this license you may not:
- modify or copy the materials;
- use the materials for any commercial purpose, or for any public display (commercial or non-commercial);
- attempt to decompile or reverse engineer any software contained on the School’s web site;
- remove any copyright or other proprietary notations from the materials; or
- transfer the materials to another person or ‘mirror’ the materials on any other server.
–jeroen
Read the rest of this entry »
Posted in Delphi, Development, JavaScript/ECMAScript, Scripting, Software Development, Systems Architecture, TypeScript | Leave a Comment »
Posted by jpluimers on 2020/12/09
In my list of things to play with: [WayBack] GitHub – DevExpress/testcafe: A Node.js tool to automate end-to-end web testing.:
A Node.js tool to automate end-to-end web testing.
Write tests in JS or TypeScript, run them and view results.
https://devexpress.github.io/testcafe
- Works on all popular environments: TestCafe runs on Windows, MacOS, and Linux. It supports desktop, mobile, remote and cloud browsers (UI or headless).
- 1 minute to set up: You do not need WebDriver or any other testing software. Install TestCafe with one command, and you are ready to test:
npm install -g testcafe
- Free and open source: TestCafe is free to use under the MIT license. Plugins provide custom reports, integration with other tools, launching tests from IDE, etc. You can use the plugins made by the GitHub community or make your own.
Related:
- [WayBack] A node.js tool to automate end-to-end web testing | TestCafe:
Use TestCafe to write tests in JS or TypeScript, run them and view results. TestCafe runs on Windows, MacOS, and Linux and takes 1 minute to set up.
- [WayBack] TestCafe: Web Testing Framework | DevExpress
100% web-based functional testing framework with integrated visual test recorder, remote device testing, and natural JavaScript API
- From download to recording your first test in less than 5 minutes — installer automatically configures your environment.
- With TestCafe, you can run tests in any browser that supports HTML5 (including IE9+, Chrome, Firefox, Safari, Opera).
- TestCafe is operating system agnostic so you can run tests on Windows, Mac or Linux machines.
- Run tests on remote computers and mobile devices.
- Run tests in multiple browsers and on multiple machines in parallel.
- Run tests in the background on any machine.
- TestCafe allows you to test web pages that require Basic and Windows HTTP Authentication.
Via:
Screen materials below the fold.
–jeroen
Read the rest of this entry »
Posted in Development, JavaScript/ECMAScript, LifeHacker, Power User, Scripting, Software Development, Testing, Web Development | Leave a Comment »
Posted by jpluimers on 2020/11/10
Two interesting sites to ease transforming JSON fragments in log-messages to a table system, for instance Excel.
- Paste the bits in [WayBack] Best JSON Pretty Print Online then fix any syntax errors.
- Copy from there to [WayBack] json2table.com and press the triangle button (run)
- Copy either the tabular or tree result to your favourite program.
- Format any numbers for readability. I really like the
Custom format ##0.00E+00 that just shows the exponents in multiples of 3 (so kilo, mega, giga, etc)[WayBack] formatting – How can I format bytes a cell in Excel as KB, MB, GB etc? – Stack Overflow
This way I copied the example code into adjecent Excel areas, so I could compare the values and calculate memory increase of a Delphi application.
—jeroen
Read the rest of this entry »
Posted in Development, JavaScript/ECMAScript, JSON, LifeHacker, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2020/10/01
For my link archive:
Back-ticks can be very useful for instance when you need to specifying json tags.
References for that:
–jeroen
Posted in Development, Encoding, Go (golang), JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »