This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func nullo(_ x: Term) -> Goal { | |
x =~ [] | |
} | |
func conso(_ a: Term, _ d: Term, _ p: Term) -> Goal { | |
p =~ .pair(a, d) | |
} | |
func appendo(_ l: Term, _ t: Term, _ out: Term) -> Goal { | |
disj { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ht to http://www.shlomifish.org/lecture/Lambda-Calculus/slides/ | |
(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))) '())))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define 定義しろ define) | |
(定義しろ 見せろ display) | |
(定義しろ 車 car) | |
(定義しろ 来るだ cdr) | |
(定義しろ 組み立てろ cons) | |
(定義しろ 原子 atom) | |
(定義しろ 同 eq) | |
(定義しろ 条件 cond) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
nesting = 0 | |
ARGF.each_line do |l| | |
nesting -= l.count("}") | |
puts " "*nesting + l | |
nesting += l.count("{") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To create and format a 10 GB hard drive image | |
dd if=/dev/zero of=hd.img bs=1048576 count=10240 | |
pdisk hd.img # `i` for initialize then `w` for write | |
# To boot from install CD, add: | |
# -drive file=dp2.iso,index=2,format=raw,media=cdrom \ | |
# -prom-env 'boot-device=ide1:9,\\BootX' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Database.js</title> | |
</head> | |
<body> | |
<script> | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
if [ "$#" -lt 1 ]; then | |
echo "usage: $0 password" >&2 | |
exit | |
fi | |
SALT=$(head -c 18 /dev/urandom | base64 | tr -d '\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>RC Scout + React example</title> | |
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.1.0/umd/react.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.1.0/umd/react-dom.production.min.js"></script> | |
<script type="text/babel"> | |
// From https://gist.github.com/davidbalbert/44f7f3329c2bcbc5b5bee2d4b93a8253 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RCScout extends React.Component { | |
rerenderScout() { | |
if (window._rcs && window._rcs.inst) { | |
window._rcs.inst.render(); | |
} | |
} | |
componentDidMount() { | |
this.rerenderScout(); | |
} |