This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, body { | |
height: 100%; | |
margin: 0; | |
} | |
body { | |
position: relative; | |
} | |
h1, h2 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Leanxml Runtime: lean TS jsxFactory runner for creating XML doms. | |
* | |
* N.B.: Doesn’t work on tagnames with uppercase first letter! | |
*/ | |
const xmldom = require('xmldom'); | |
function leanxml(tagname, attrs, ...children) { | |
return function leanxmlBuilder(doc) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /tmp | |
$ mkdir test | |
$ cd test | |
$ git init | |
Initialized empty Git repository in /private/tmp/test/.git/ | |
$ git commit --allow-empty -m root | |
[master (root-commit) 6814cc9] root | |
$ mkdir foo | |
$ echo a > foo/a | |
$ git add foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* interleave([1,2], [8,7,6,5], [], 'abc') | |
* => [ 1, 8, 'a', 2, 7, 'b', 6, 'c', 5 ] | |
*/ | |
function* interleave() { | |
const its = Array.from(arguments).map(x => x[Symbol.iterator]()); | |
let done; | |
do { | |
done = true; | |
for (const it of its) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu -o pipefail | |
${DEBUGSH+set -x} | |
# where to store the sparse-image | |
NAME=civol | |
SPARSELOC=~/Documents/$NAME.dmg | |
FSTYPE="APFS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const child_process = require('child_process'); | |
const process = require('process'); | |
process.on('SIGINT', () => console.log("ooh this is sigint")); | |
process.on('SIGUSR1', () => console.log("oh this is sigusr1!!")); | |
function block4ever() { | |
setTimeout(() => {} , 1000000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simplistic directory watcher | |
// | |
// example usage: | |
// | |
// $ node watch.js | while read line ; do echo compiling ... ; ( while read -r -t 0; do read -r ; done ) ; rm -rf build ; npm run build ; echo done ; done | |
// | |
var fs = require('fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Open the .celtx file in an editor, look for the bit between <html> and </html>, put it in a new file (filename ending in .html), add this bit between one of the <style> and </style> tags. Open in a webbrowser, click print. */ | |
body { | |
font-family: monospace; | |
font-size: 13pt; | |
line-height: 1.4em; | |
width: 190mm; | |
margin: 0; | |
padding: 1em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### GIT STUFF | |
# gitlog only the specified revision(s), e.g. $ gitlog1 master some-feature-branch | |
alias gitlog1='git log --color --graph --format="format:%C(normal bold)%h%Creset %s%C(red)%d%Creset (%C(yellow)%aN%Creset, %C(green)%ar%Creset)"' | |
# Entire git commit history with tree and colors and branch names | |
alias gitlog='gitlog1 --all --branches=\* --remotes=\*' |