Skip to content

Instantly share code, notes, and snippets.

@iboard
iboard / shell.exs
Last active April 15, 2020 08:07
Elixir-script template for the commandline.
#!/usr/bin/env elixir
#
# A Template for writing an Elixir script to be used on the
# command-line.
#
# (c) 2019 by Andreas Altendorfer <andreas@altendorfer.at>
# License: Free to use without any warranty.
#
# Usage:
# 1. Add your command to strict and aliases on @opts
DROP DATABASE IF EXISTS 📚;
CREATE DATABASE 📚;
USE 📚;
CREATE TABLE 👤(
🔑 INTEGER PRIMARY KEY,
🗣 varchar(64), -- name
🗓 DATE -- date of registration
@ovstetun
ovstetun / ResId.scala
Last active March 31, 2016 16:33
binding trait instance
trait ResId {
def toASCIIString: String
}
object ResId {
def apply(uri: String): ResId = new StringUri(uri)
def apply(uri: URI): ResId = new StringUri(uri.toString)
private def validated(uri: String): String = URI.create(uri).toString
case class StringUri(value: String) extends ResId {
override val toASCIIString: String = validated(value)
@Avaq
Avaq / combinators.js
Last active June 14, 2024 10:46
Common combinators in JavaScript
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))
@staltz
staltz / introrx.md
Last active June 17, 2024 20:46
The introduction to Reactive Programming you've been missing
@mbostock
mbostock / .block
Last active January 27, 2024 14:53
A Less-Angry Rainbow
license: gpl-3.0
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@jorgeyp
jorgeyp / HAIWORLD.LOL
Created September 29, 2010 15:17
LOLCODE HAI WORLD
BTW HAI WORLD in LOLCODE ("BTW" means comment)
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE