Skip to content

Instantly share code, notes, and snippets.

View tkers's full-sized avatar
🍒

Tijn Kersjes tkers

🍒
View GitHub Profile
@annakrasner
annakrasner / index.html
Last active April 29, 2024 16:32
InkyDoc: a google doc formatting Apps Script for the Ink Narrative Scripting Language
<!--
Change polling sidebar based from
//https://gist.github.com/tanaikech/f27d427f07b20ca9fedec21e643c4a3e
Inkjs runtime+ compiler from https://github.com/y-lohse/inkjs/releases/tag/v2.2.2
Ink js webplayer from https://yannick-lohse.fr/inkjs/
-->
<body>
@acutmore
acutmore / README.md
Last active January 21, 2024 20:30
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3
@horttanainen
horttanainen / js-shell.sh
Created April 14, 2019 11:52
execute javascript in shell
#!/usr/bin/env bash
JS='
var input = "";
if (process.argv[1] === "-p") {
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(buf) {
input += buf;
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@vergenzt
vergenzt / zsh_theme_git_prompt.md
Created July 22, 2015 15:17
Zsh: Available ZSH_THEME_GIT_PROMPT_* variables
$ grep -o "ZSH_THEME_GIT_[A-Z_]\+" lib/git.zsh| sort | uniq
ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX
ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX
ZSH_THEME_GIT_PROMPT_ADDED
ZSH_THEME_GIT_PROMPT_AHEAD
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR
ZSH_THEME_GIT_PROMPT_BEHIND
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE
@adambray
adambray / pair_programming_exercises.md
Last active October 21, 2021 14:03
Pair Programming Exercises

Number to Ordinal

See full kata at codewars

Finish the function numberToOrdinal, which should take a number and return it as a string with the correct ordinal indicator suffix (in English). That is:

  • numberToOrdinal(1) ==> '1st'
  • numberToOrdinal(2) ==> '2nd'
  • numberToOrdinal(3) ==> '3rd'
  • numberToOrdinal(4) ==> '4th'
@alehandrof
alehandrof / simpletask gtd.md
Last active May 15, 2024 14:25
How to GTD with Simpletask

How to GTD with Simpletask

This is a guide to implementing Getting Things Done (GTD) using [Simpletask][] by [Mark Janssen][].

Simpletask uses the [todo.txt][] syntax, but has sufficient differences and quirks of its own to be worth describing in detail---at least, that's the story I'm going with. I actually began this guide as an exploration of my own trusted system. Personal workflows are by definition eccentric; I have included only what seems to me to be broadly useful.

This implementation of GTD covers the "standard" classifications: next actions by context, projects, somedays, agendas by person and meeting, etc. In a departure from strict GTD, each entry in these lists is also tagged with an area of focus, interest or responsibility. I find that the ability to slice the system by this extra dimension is worth the additional complexity at the processing and organizing stages. Limitations, issues and workarounds are discussed at the end.

Before we begin, some words of wisdom

@RickCarlino
RickCarlino / gforth_cheat_sheet.md
Last active November 16, 2023 21:05
gforth cheat sheet

Math

  • .s - Show the stack
  • +, -, *, mod - Math operators
  • /mod - performs both / and mod

Stack manipulation

  • drop and 2drop - drop a stack item (once / twice)
  • dup - duplicate a stack item
  • rot - rotate the stack
@rb2k
rb2k / gist:8372402
Last active April 15, 2024 19:30
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@ozten
ozten / Fauxgermanhausen_bookmarklet.js
Created April 30, 2013 21:54
Fauxgermanhausen das Pagen! Bookmarklet
javascript:(function(){var%20prefixes=['','glocken','das','borfa','maushe','uber'],suffixes=['','hausen','%20die%20vander','gleuten','noshan','flagellan','mek','dak','en%20das','ga'],xPathResult=document.evaluate('.//text()[normalize-space(.)!=\'\']',document.body,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),i,textNode,cnt,out,j,pfx,sfx;for(i=0,l=xPathResult.snapshotLength;i<l;i++){textNode=xPathResult.snapshotItem(i);if(textNode.parentNode.nodeName.toLowerCase()=='script'||textNode.tagName=='style')continue;cnt=textNode.data.split(/\s/g);out=[];for(j=0;j<cnt.length;j++){if(cnt[j].replace(/[\s]/g,'')=='')continue;pfx=(!Math.floor(Math.random()*10))?'':prefixes[Math.floor(Math.random()*prefixes.length)];sfx=(!Math.floor(Math.random()*10))?'':suffixes[Math.floor(Math.random()*suffixes.length)];out.push(pfx+cnt[j]+sfx);}textNode.data='%20'+out.join('%20')+'%20';}})();