Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
import type { Kysely, RawBuilder } from "kysely"; | |
import type { Account } from "next-auth"; | |
import type { | |
Adapter, | |
AdapterSession, | |
VerificationToken, | |
AdapterUser, | |
} from "next-auth/adapters"; | |
import type { DB } from "shared"; |
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "ctrl+h", | |
"command": "workbench.action.focusLeftGroup", | |
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'" | |
}, | |
{ | |
"key": "ctrl+l", | |
"command": "workbench.action.focusRightGroup", |
Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.
Source: tutorialspoint.com
There is an ongoing shift in programming towards a more constrained mindset, recognizing shared mutable state and side effects as significant sources of accidental complexity and concepts like immutability and reactive, unidirectional pipelines as ways to overcome it. Simplicity is less optional than before, based on an understanding about the limited capacity of human working memory and based on programming language theory and practice. The functional programming ideas seeping into the mainstream leave less people to say that they wouldn't need them because of maybe never having used them.
The basic idea of controlling complexity through constraints is not novel at all, though, and it raises a valid question about why this shift has taken so long to develop, despite the overall trends towards automation and productivity. For example, the distincti
function Grid(cells, generation, cell_scale){ | |
this.text = " all work and no play makes jack a dull boy "; | |
// cells | |
this.cells = cells; | |
this.generation = generation; | |
// scale | |
this.cell_scale = cell_scale; | |
// create next generation | |
this.next_gen = function(ruleset){ |
CREATE FUNCTION key_underscore_to_camel_case(s text) | |
RETURNS json | |
IMMUTABLE | |
LANGUAGE sql | |
AS $$ | |
SELECT to_json(substring(s, 1, 1) || substring(replace(initcap(replace(s, '_', ' ')), ' ', ''), 2)); | |
$$; | |
-- TODO: add recursive processing | |
CREATE FUNCTION json_underscore_to_camel_case(data json) |