Skip to content

Instantly share code, notes, and snippets.

View oubiwann's full-sized avatar
💭
🌌

Duncan McGreggor oubiwann

💭
🌌
View GitHub Profile
@oubiwann
oubiwann / devstack.rb
Created February 15, 2012 21:24 — forked from termie/devstack.rb
Vagrant script for devstack
Vagrant::Config.run do |config|
sshdir = "#{ENV['HOME']}/.ssh/"
checkout = (ENV['COOKBOOKS'] or "#{ENV['HOME']}/lab/OpenStack/openstack-cookbooks")
ip_prefix = (ENV['IP_PREFIX'] or "10.0.5.")
mac_prefix = (ENV['MAC_PREFIX'] or "080027027")
suffix = "100"
ip = "#{ip_prefix}#{suffix}"
config.vm.box = "oneiric"
config.vm.box_url = "http://images.ansolabs.com/vagrant/oneiric64.box"
config.vm.customize ['modifyvm', :id, '--memory', '350']
@oubiwann
oubiwann / gist:3381472
Created August 17, 2012 18:44 — forked from lentil/gist:810399
Unit tests, PEP8, PyFlakes pre-commit hook in Python (with interactive support!)
#!/usr/bin/env python3
import os
import re
import shutil
import subprocess
import sys
import tempfile
def system(*args, **kwargs):
(defmodule imp (export (bar 0)))
(eval-when-compile
(defun import-function-1 (module function)
;(: io format '"~p~p~n" (list module function))
(let ((mod-fun (list_to_atom
(: lists concat (list module '":" function)))))
; (: io format '"~p~n" (list mod-fun))
(defmodule lfe_riak
(import (rename erlang ((list_to_binary 1) l2b))
(rename riak_object ((get_value 1) get))
(from lists (foreach 2) (map 2) (foldl 3))
(rename dict
((merge 3) make-merged-dict)
((new 0) make-dict)
((from_list 1) make-dict-from-list)
((to_list 1) make-list-from-dict)))
(export (hello 0)
;;; Global clock implementation of Life.
(defmodule life_sync_cell
(export (start_link 1) (set_neighbours 2) (tick 1)
(init 1) (handle_cast 2))
(using gen_server)
(behaviour gen_server))
(include-file "deps/lfe_utils/include/using.lfe")
;;; Exported:
@oubiwann
oubiwann / lfe-repl-1.lfe.lisp
Created April 14, 2013 22:35 — forked from anonymous/lfe-repl-1.lfe.lisp
Intro to LFE REPL
$ ./bin/lfe -pa ./ebin
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [async-threads:0] [kernel-poll:false]
LFE Shell V5.9.1 (abort with ^G)
> (+ 1 2)
3
>
@oubiwann
oubiwann / tools.lfe
Last active December 30, 2015 00:59 — forked from anonymous/tools.lisp
;; -*- LFE -*-
;; macrology only, so can be included before module definition
;;
;; These were created by Wojciech Kaczmarek and posted to the LFE mail list here:
;; https://groups.google.com/d/msg/lisp-flavoured-erlang/MiTGdMjav_k/mSIPCwgFNT8J
;; macro-building bits
(defmacro body-list () '(= body _))
(defmacro args-list () '(= args _))
@oubiwann
oubiwann / pull-request.md
Last active April 26, 2018 15:35 — forked from piscisaureus/pr.md
Getting pull request branches for a project

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section, e.g.:

@oubiwann
oubiwann / 01-setup.sh
Last active November 11, 2018 13:56 — 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
$ git clone https://github.com/oubiwann/linear-regression-tutorial.git
$ cd linear-regression-tutorial
$ make