Skip to content

Instantly share code, notes, and snippets.

View edw's full-sized avatar

Edwin Watkeys edw

View GitHub Profile
@edw
edw / flashcards.scm
Last active January 30, 2017 18:41
French numbers flashcard quiz
#!/usr/local/bin/guile -s
!#
(use-modules (ice-9 rdelim))
(define (show-card face content)
(cond ((equal? face 'front)
(display "QUESTION")
(newline)
(display content))
@edw
edw / dot-tmux.conf
Last active December 7, 2016 19:48
Tmux configuration file
bind | split-window -h
bind - split-window -v
bind 'C-\' last-window
set -g default-terminal "screen-256color"
@edw
edw / hilbert-7.svg
Last active August 12, 2016 15:52
Hilbert Curves
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
;; This buffer is for Clojure experiments and evaluation.
;; Press C-j to evaluate the last expression.
(defn fib [n]
(Math/round (/ (- (Math/pow (+ 1 (Math/sqrt 5)) n)
(Math/pow (- 1 (Math/sqrt 5)) n))
(* (Math/pow 2 n) (Math/sqrt 5)))))
(map (fn [_] (int (Math/floor (* 16 (Math/random))))) (range 16))
@edw
edw / fib.el
Last active May 6, 2016 12:29
Compute the `n`th Fibonacci number in constant time
(defun fib (n)
"Compute the `n'th Fibonacci number in constant time"
; http://mathworld.wolfram.com/FibonacciNumber.html
(let ((sqrt5 (sqrt 5)))
(round (/ (- (expt (+ 1 sqrt5) n) (expt (- 1 sqrt5) n))
(* (expt 2 n) sqrt5)))))
@edw
edw / pixie-math.pxi
Created January 12, 2016 16:26
IEEE math for Pixie
(ns pixie.math
(require pixie.ffi-infer :refer :all))
(with-config {:library "m"
:cxx-flags ["-lm"]
:includes ["math.h"]}
(defconst M_E)
(defconst M_LOG2E)
(defconst M_LOG10E)
(defconst M_LN2)
@edw
edw / error.txt
Created December 17, 2015 14:18
Pixie build error
[platform:execute] gcc /tmp/usession-default-0/platcheck_20.o -pthread -Wl,--export-dynamic -lffi -lrt -o /tmp/usession-default-0/platcheck_20
Traceback (most recent call last):
File "externals/pypy/rpython/bin/rpython", line 20, in <module>
main()
File "/usr/src/pixie/externals/pypy/rpython/translator/goal/translate.py", line 217, in main
targetspec_dic, translateconfig, config, args = parse_options_and_load_target()
File "/usr/src/pixie/externals/pypy/rpython/translator/goal/translate.py", line 156, in parse_options_and_load_target
targetspec_dic = load_target(targetspec)
File "/usr/src/pixie/externals/pypy/rpython/translator/goal/translate.py", line 98, in load_target
mod = __import__(specname)
@edw
edw / roadtrip.md
Last active September 22, 2015 12:58
Road Trip Autumn 2015

Road Trip Autumn 2015

Leaving evening of September 24. Staying 9/29 at Becky's in Long Beach, CA. Arriving home night of October 5.

Route

Generally, I-70 out: Manhattan → New Stanton, PA → St. Louis, MO → Brewster, KS → Cedar City, UT → Long Beach, CA.

Similarly, I-40 back: Long Beach, CA → Joshua Tree, CA → Sedona, AZ → North Rim, Grand Canyon, AZ → Tucumcari, NM → Broken Arrow, OK → Nashville, TN → Lynchburg, VA → Brooklyn.

@edw
edw / init.el
Created August 26, 2015 18:00
Selected Emacs `init.el`-isms
(setq mac-option-key-is-meta t)
(setq mac-right-option-modifier nil)
(setq ns-function-modifier 'hyper)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t)
(add-to-list 'package-pinned-packages
'(cider . "melpa-stable") t)
@edw
edw / recommended.md
Created August 25, 2015 11:54
Recommended Reading