Skip to content

Instantly share code, notes, and snippets.

@cedws
cedws / defer.sh
Last active July 5, 2024 13:31
Go-like defer 'keyword' for shell
#!/bin/sh
DEFER=
defer() {
DEFER="$*; ${DEFER}"
trap "{ $DEFER }" EXIT
}
@Ircama
Ircama / PT-P300BT.md
Last active February 23, 2025 15:54
Print to Brother PTP300BT from a computer
@sahmeepee
sahmeepee / launch.json
Created June 20, 2021 18:05
VSCode setup for Playwright Test Runner - allows debug of current file
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch all tests 3 browsers",
"request": "launch",
"runtimeArgs": [
"run-script",
"tests3x"
],
@nazarewk
nazarewk / README.md
Last active July 14, 2024 07:39
difftastic wrapper providing HTML and easier consumable JSON outputs

This is a pure-Python script which builds on top of difftastics --display json to provide:

  • more ergonomic and ready to use JSON output
  • slightly styled HTML table (mimics side-by-side)

it addresses following shortcomings of current (v0.51.1) JSON output:

  • line-scoped changes within block-scoped chunks are unordered (different each time), had to be sorted by rhs.line_number then lhs.line_number
  • there seems to be a lot of conscutive single-character entries of same type (highlight) for some (probably unknown?) languages, those are merged

addresses Wilfred/difftastic#45

@geovannimp
geovannimp / cSpell_packageJson_dictionary.md
Last active May 8, 2024 23:21
cSpell package.json dictionary

cSpell package.json dictionary with monorepo support

Create the following files in the .vscode folder of your repo

.vscode/cspell.json

{
  "import": ["./cspell-node.config.cjs"]
}

.vscode/cspell-node.config.cjs

@vedantroy
vedantroy / demo.ts
Last active December 31, 2024 09:15
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);