Skip to content

Instantly share code, notes, and snippets.

@cfx
cfx / gist:4f2ff442ef293ad9e087
Created February 9, 2015 08:47
Binet's formula for nth fib number
(require 'cl)
(defun fib(n p c a)
(if (> c n)
(reverse a)
(let ((new (+ c p)))
(fb n c new (cons c a)))))
;; dummy
(defun find-fibs(l)
~/Projects/vd2 (stable)$ be cap qa deploy
* 2014-10-27 11:29:58 executing `qa'
Deploying from branch/tag: current_release
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
executing locally: "git ls-remote git@github.com:vzaar/vd2.git current_release"
command finished in 1899ms
triggering start callbacks for `deploy'
* 2014-10-27 11:30:09 executing `multistage:ensure'
* 2014-10-27 11:30:09 executing `deploy'
triggering before callbacks for `deploy'
(ql:quickload :cl-ppcre)
(defpackage :solitaire-cipher)
(in-package :solitaire-cipher)
(defun encrypt (str)
(let* ((input (string->list-of-numbers str))
(ks (keystream->numbers (keystream (+ 1 (* 5 (length input)))))))
@cfx
cfx / init.el
Last active October 6, 2015 18:58
latest emacs config
;; paths
(if (not (getenv "TERM_PROGRAM"))
(let ((path (shell-command-to-string
"$SHELL -cl \"printf %s \\\"\\\$PATH\\\"\"")))
(setenv "PATH" path)
(setq exec-path (split-string path ":"))))
;;remove vc-git
(setq vc-handled-backends ())
@cfx
cfx / gist:2036253
Created March 14, 2012 12:51
Y combinator in ruby
lambda { |m|
lambda { |f| f.call(f) }.call(
lambda { |f|
m.call(lambda { |x| f.call(f).call(x) })}) }
e.g
lambda { |m|
lambda { |f| f.call(f) }.call(
lambda { |f|