Skip to content

Instantly share code, notes, and snippets.

David Albert davidbalbert

Block or report user

Report or block davidbalbert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fizzbuzz.sld
; ht to
(define λ lambda)
(define 0 (λ (f) (λ (x) x)))
(define +1 (λ (n) (λ (f) (λ (x) (f ((n f) x))))))
(define pred_next_tuple
(λ (tuple)
(cons (car (cdr tuple)) (cons (+1 (car (cdr tuple))) '()))))
View japanese.sld
(define 定義しろ define)
(定義しろ 見せろ display)
(定義しろ 車 car)
(定義しろ 来るだ cdr)
(定義しろ 組み立てろ cons)
(定義しろ 原子 atom)
(定義しろ 同 eq)
(定義しろ 条件 cond)
View autoindent.rb
#!/usr/bin/env ruby
nesting = 0
ARGF.each_line do |l|
nesting -= l.count("}")
puts " "*nesting + l
nesting += l.count("{")
davidbalbert /
Last active Jan 14, 2019
Install and run Mac OS X DP2 in QEMU
# To boot from install CD, add:
# -drive file=dp2.iso,index=2,format=raw,media=cdrom \
# -prom-env 'boot-device=ide1:9,\\BootX' \
# Verbose mode:
# -prom-env 'boot-args=-v debug=0xffe kdp=2' \
# OpenFirmware prompt:
View euler15.js
function countPossibilities(n, m) {
if (n === -1 || m === -1) {
return 0;
} else if (n === 0 && m === 0) {
return 1;
return countPossibilities(n-1, m) + countPossibilities(n, m-1);
View database.html
<!DOCTYPE html>
<meta charset="utf-8">
'use strict';
davidbalbert / ssha1.bash
Created Dec 7, 2017
Generate a hashed password with random salt in the OpenLDAP SSHA format (seeded SHA-1). For use with FreeRADIUS.
View ssha1.bash
set -euo pipefail
if [ "$#" -lt 1 ]; then
echo "usage: $0 password" >&2
SALT=$(head -c 18 /dev/urandom | base64 | tr -d '\n')
View rcscout_react_example.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>RC Scout + React example</title>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script type="text/babel">
// From
davidbalbert / rcscout-react-babel.js
Last active Nov 10, 2017
Support for running RC Scout with React
View rcscout-react-babel.js
class RCScout extends React.Component {
rerenderScout() {
if (window._rcs && window._rcs.inst) {
componentDidMount() {
View time_with_zone_comparison_bug.rb
# frozen_string_literal: true
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
gemfile(true) do
You can’t perform that action at this time.