Skip to content

Instantly share code, notes, and snippets.

abstract AbstractCons
immutable Nil <: AbstractCons
end
const nil = Nil()
immutable Cons{H, T} <: AbstractCons
h::H
t::T
adobemapping
beamer
biber
biblatex
booktabs
boondox
cleveref
ec
enumitem
etoolbox
srand(42)
macro debug(exprs...)
quote
$(map(_debug, exprs)...)
end
end
function _debug(expr)
#!/bin/bash
set -xv
set -o nounset
set -o errexit
set -o pipefail
set -o noclobber
export IFS=$' \t\n'
export LANG=en_US.UTF-8
module Log
macro debug(exprs...)
quote
$(map(_debug, exprs)...)
end
end
function _debug(expr)
.separator "\t"
select visit_date, url, title
from moz_historyvisits v
join moz_places p
on v.place_id = p.id
order by visit_date
;
zmodload zsh/mathfunc
function get_tick(){
local x1="$1"
local x2="$2"
[[ "$x1" -le "$lx2" ]]
local dx="$(get_interval "$((x2 - x1))")"
local lower="$(get_lower "$x1" "$dx")"
local upper="$(get_upper "$x2" "$dx")"
ENV['SHELL'] = '/bin/bash'
ENV['SHELLOPTS'] = 'pipefail:errexit:nounset:noclobber'
PYTHON = ENV['PYTHON'] || 'python'
def run(t, cmd)
puts cmd
unless Rake::FileUtilsExt.nowrite_flag
ok = system(ENV['SHELL'], '-c', cmd)
module Transducers
import Base: map, filter
transduce(xf, f, init, xs) = foldl(xf(f), init, xs)
function filter(f)
function xf(rf)
function xrf(ret, x)
if f(x)
parse_stem = $(subst @, ,$(1))
declare = declare -r $(call parse_stem,$(1))
args = $(addprefix --,$(call parse_stem,$(1)))
get = $(wordlist 2,2,$(subst =, ,$(filter $(1)=%,$(call parse_stem,$(2)))))