Skip to content

Instantly share code, notes, and snippets.

View oubiwann's full-sized avatar
💭
🌌

Duncan McGreggor oubiwann

💭
🌌
View GitHub Profile
Pulling lfe from {git,"git://github.com/rvirding/lfe.git","develop"}
Cloning into 'lfe'...
Pulling 'lfe-utils' from {git,"https://github.com/lfe/lfe-utils.git","master"}
Cloning into 'lfe-utils'...
Pulling lfeunit from {git,"git://github.com/lfe/lfeunit.git","master"}
Cloning into 'lfeunit'...
Pulling lfest from {git,"git://github.com/lfex/lfest.git","master"}
Cloning into 'lfest'...
Pulling yaws from {git,"git://github.com/klacke/yaws.git","master"}
Cloning into 'yaws'...
@oubiwann
oubiwann / 01-setup.sh
Last active January 16, 2025 00:43 — forked from digego/keynote.scm
Instructions for Running Andrew Sorensen's OSCON 2014 Keynote Performance
$ git clone https://gist.github.com/8b4404e538e61c7996a5.git
$ cd 8b4404e538e61c7996a5
$ mkdir salamander && cd salamander
$ curl -L -O https://archive.org/download/SalamanderDrumkit/salamanderDrumkit.tar.bz2
$ curl -L -O https://github.com/johnsen/drumsandpercussion/blob/master/SalamanderKick/salamanderdrum-kick-r1.tar.gz
$ curl -L -O http://freepats.zenvoid.org/Piano/SalamanderGrandPianoV3_44.1khz16bit.tar.bz2
$ tar xvfz salamanderDrumkit.tar.bz2
$ tar xvfz salamanderdrum-kick-r1.tar.gz
$ mv Kick/kick* OH/
$ tar xvfz SalamanderGrandPianoV3_44.1khz16bit.tar.bz2
@oubiwann
oubiwann / 01-values.lfe
Last active August 29, 2015 14:03
Using Levenshtein Distance and Team Analysis to Reveal Inherent Engineering Org Structure
> (defun int-exp (a b)
(trunc (math:pow a b)))
int-exp
> (set lfe (int-exp 2 0))
1
> (set hy (int-exp 2 5))
32
> (set clojure (int-exp 2 6))
64
> (bxor clojure (bxor lfe hy))
@oubiwann
oubiwann / output.lfetool.txt
Created June 30, 2014 00:31
"lfetool commands" output
$ lfetool2 commands
commands - List all the top-level commands available to lfetool.
extract - lfetool is no longer compressed; this is a no-op (included for
backwards compatibility only).
help - Get the general help for lfetool; if passed a plugin name as
an argument, display the help for that plugin.
info - Get information of the type indicated by the passed argument.
install - Install LFE by default; if passed an argument, in stall the
indicated software.
repl - By default, start an LFE REPL with access to all the
@oubiwann
oubiwann / ring.lfe
Last active December 14, 2019 00:43
Ring Benchmark in Lisp Flavored Erlang
;; The code below was translated from the Erlang ring benchmark hosted
;; at http://benchmarksgame.alioth.debian.org, written by Jiri Isa and
;; optimized by Shun Shino:
;; http://goo.gl/5YOjg3
;;
;; The LFE version split the logic of the above-mentioned Erlang code
;; into more functions for increased clarity.
;;
(defmodule ring
(export
@oubiwann
oubiwann / 01-manual-routes.lfe
Last active August 29, 2015 14:01
LFE Routes
(defun routes
"Routes for the Volvoshop REST API."
;; /order
(((list "order") method arg-data)
(order-api method arg-data))
;; /order/:id
(((list "order" order-id) method arg-data)
(order-api method order-id arg-data))
;; /orders
(((list "orders") method arg-data)
@oubiwann
oubiwann / 01-elxir_from_lfe.bash
Last active August 29, 2015 14:01
Elixir from LFE
# update rebar.config to include Elixir
$ make get-deps
$ make compile
$ lfetool repl lfe -pa ./deps/elixir/lib/elixir/ebin/
@oubiwann
oubiwann / lfe_latest.txt
Last active August 29, 2015 14:01
Latest in the world of LFE
Released Features
* Maps in LFE.
* A new (run ...) REPL command run running LFE shell commands.
* Now possible to define functions and macros in the REPL.
* Strings no longer need to be quoted.
* LFE now has Common Lisp macros (prog1 ...) and (prog2 ...).
* (mod:func ...) syntax now supported.
* New (fields-name) macro for easier usage of Mnesia from LFE.
* #| ... |# Common Lisp-style multiline comments now supported.
@oubiwann
oubiwann / huge-number.lfe
Last active August 29, 2015 14:00
Playing with tail-recursive factorial in LFE
This file has been truncated, but you can view the full file.
> (factorial 4000000)
exception error: system_limit
in (: erlang
*
3229797
30123180888527072598754061749733156956836010853066267762188108601162877
501605950711425018360722033156484485761208096373181054336452668279306575186488
625487378757417504192553057885369932190386049370641878631432583447644047021486
245708528594358523103979850867383263694029300939124590581455105879597555548321
332105886291655143516998679067067107752904759587500859444578397785006406762423
@oubiwann
oubiwann / .bashrc
Last active August 29, 2015 14:00
Bash RC
[ -z "$PS1" ] && return
export HISTCONTROL=ignoreboth
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes