Skip to content

Instantly share code, notes, and snippets.

Available for hire

Dan Dart danwdart

Available for hire
View GitHub Profile
serras /
Created Dec 15, 2020
Advent of Haskell 2020

Talking about Toys

Every year Santa 🎅 brings joy (and presents 🎁) to all the kids in the world. Well, not when I was a child! Following the usual Spanish traditions, the Three Reyes Magos brought me presents in their camels 🐫 following the Star 💫 Nowadays, it's Sinterklaas who puts pepernoten in my shoes 👞. Because in fact there's not one, but a group of present-bringing people, distributed across the globe 🌐, each with their own part of the world to cover (or you really thought just one man and eight reindeers could do it all by their own?)

In order to communicate, they need a way to exchange information about presents. Since they are all very wise, they've agreed to use Haskell, so this information is represented using algebraic data types. Here are some types related to building blocks:

data Block = Block BlockBrand String Color
data BlockBrand = LegoKNex
evanjs /
Created Jul 14, 2020
winbox script/expression for nix
#!/usr/bin/env nix-shell
#! nix-shell -p wine -i sh
wine ~/bin/winbox.exe
# non nix (dependencies) version
colemickens /
Last active Jul 12, 2021

Easy Amiibo Emulation -

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord:

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

myshov / function_invocation.js
Last active Apr 4, 2021
11 Ways to Invoke a Function
View function_invocation.js
(_ => console.log(2))();
eval('console.log(3);');, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);, null, [9]);, null, 10);
Avaq / combinators.js
Last active Jul 23, 2021
Common combinators in JavaScript
View combinators.js
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
View emscripten.php
function compileCPP(string $sourcePath, string $binaryPath): bool {
$descriptorspec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w']
$cwd = '/tmp';
naholyr /
Last active Mar 5, 2021
Git(Hub)-backed comments system

General context

  • A static website using a generator (like Jekyll)
  • Comments are in a folder, one comment = one JSON file (attached to article based on path + filename)
  • website is versionned using git, repository hosted by github (cool for pull-requests)

Posting a new comment

OK here we need some dynamism ;)

afabbro /
Created Sep 21, 2012
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:


TooTallNate / bbs.js
Created Mar 16, 2012 — forked from substack/bbs.js
Running a node.js REPL over `curl`
View bbs.js
* Requires node v0.7.7 or greater.
* To connect: $ curl -sSNT. localhost:8000
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
kevinSuttle /
Last active Jul 21, 2021 — forked from lancejpollard/
List of Usable HTML Meta and Link Tags