Skip to content

Instantly share code, notes, and snippets.

@Avaq
Avaq / combinators.js
Last active May 19, 2024 00:21
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))
@wycleffsean
wycleffsean / accio.rake
Created December 9, 2016 17:10
Heroku Accio DB
namespace :accio do
desc "Drop/restore database from Heroku backup"
task :db do
Rake::Task['accio:download_backup'].invoke
Rake::Task['accio:restore_backup'].invoke
end
desc "Download database dump from Heroku"
task :download_backup => [:logger_no_env, '~/.netrc'] do |t, args|
return Rails.logger.error('curl not installed') unless \
@andrewrk
andrewrk / build.zig
Created February 20, 2023 16:20
sprinkling a little zig into a C project to help with debugging
const std = @import("std");
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard optimization options allow the person running `zig build` to select