Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Available for hire

Dan Dart danwdart

💻
Available for hire
View GitHub Profile
@serras
serras / advent-haskell-2020.md
Created Dec 15, 2020
Advent of Haskell 2020
View advent-haskell-2020.md

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
evanjs / linbox.sh
Created Jul 14, 2020
winbox script/expression for nix
View linbox.sh
#!/usr/bin/env nix-shell
#! nix-shell -p wine -i sh
wine ~/bin/winbox.exe
# non nix (dependencies) version
@colemickens
colemickens / amiibo-emulation-with-linux-vm.md
Last active Jul 12, 2021
amiibo-emulation-with-linux-vm.md
View amiibo-emulation-with-linux-vm.md

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ 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: https://discord.gg/SQNEx9v.

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
myshov / function_invocation.js
Last active Apr 4, 2021
11 Ways to Invoke a Function
View function_invocation.js
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@Avaq
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
<?php
function compileCPP(string $sourcePath, string $binaryPath): bool {
$descriptorspec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w']
];
$cwd = '/tmp';
@naholyr
naholyr / 0.github-backed-comments.md
Last active Mar 5, 2021
Git(Hub)-backed comments system
View 0.github-backed-comments.md

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
afabbro / webkit-pseudo-elements.md
Created Sep 21, 2012
Webkit Pseudo-Element Selectors (Shadow DOM Elements)
View webkit-pseudo-elements.md

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:

-webkit-appearance:none;

@TooTallNate
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
kevinSuttle / meta-tags.md
Last active Jul 21, 2021 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags