Skip to content

Instantly share code, notes, and snippets.

View goofballLogic's full-sized avatar
👔
Still counting things

Andrew Stewart Gibson goofballLogic

👔
Still counting things
  • 18:08 (UTC +01:00)
View GitHub Profile
Create the app:
npm init
Add React:
npm install --save react react-dom
Add webpack:
npm install --save-dev webpack webpack-cli webpack-dev-server
Add babel:
long[] Consume(long[] source, long quantity)
{
var acc = 0L;
bool Accumulate(long x)
{
if (acc > quantity) return false;
acc += x;
return true;
}
return source.SkipWhile(Accumulate).ToArray();

Event-driven styles

Whether in the browser, on the server or in some other environment (e.g. Electron), the event-driven nature of JavaScript's early years is never that far away.

In the browser, the HTML DOM API provides a wealth of event-based interactions, but there are many other common browser APIs (e.g. Messaging, Indexed DB, XHR, Service Workers) which employ similar patterns.

On the server, in e.g. node.js, HTTP pipelines, streaming APIs and EventEmitters are three massive areas of JavaScript programming which employ event-driven programming heavily.

The DOM

Last updated: April 2024

Technology/Practice Years of usage
NET 5, .NET Core, .NET Framework 21 2003…
Agile, Agile Transformation 13 2006…
ASP, ASP.Net, ASP.Net MVC, ASP.NET Core MVC 18 2003…
AWS – EC2, S3, Lambda, CodePipeline, CloudFront 2 2013…
Azure – Functions, App Services, Storage, SQL, AKS, Cost Mgmt. 6 2014…
Azure DevOps (aka TFS, Team Foundation Server) 6 2006…
Backbone JS, Sammy JS, Microsoft AJAX Extensions 5 2006…2013
{
"@context": {
"@vocab": "http://example.com/"
}
}
Feature: Application branding
As Doogie
I want to be bathed in the familiar blue glow of my IBM CRT monitor and text editor
So that I can shift into the right mental model for an uplifting closing diary entry
Background: Load the app
Given I have loaded the app
Scenario: Styling
Then the background colour should be "bright blue"
Feature: Reading diary entries
As Doogie
I want to be able to review my previous diary entries in reverse chronological order
So that I can scan my recent thoughts easily
Scenario: The latest entry should be shown at the top
Given a test entry exists dated 1 month into the future
"""
Raymond and I have a lot in common.
We both have to face prejudice for what we are...
Feature: Writing a diary entry
As Doogie
I want to be able to write a new entry in my diary
So that I can round off an episode with an uplifting thought
Background: Load the app and start editing
Given I have loaded the app
When I press the space bar
Scenario: I should be able to press space bar to start writing
Feature: Writing a diary entry
As Doogie
I want to be able to write a new entry in my diary
So that I can round off an episode with an uplifting thought
Feature: Reading diary entries
As Doogie
I want to be able to review my previous diary entries in reverse chronological order
So that I can scan my recent thoughts easily