Skip to content

Instantly share code, notes, and snippets.

View wolverian's full-sized avatar

Ilmari Vacklin wolverian

View GitHub Profile
@wolverian
wolverian / casper-function-passing.js
Created September 12, 2012 09:48
CasperJS: passing a function to casper.evaluate() passes undefined instead
var casper = require('casper').create({
verbose: true,
logLevel: 'debug'
});
casper.start('http://www.google.com', function() {
console.log('opened page');
this.on('page.error', function(msg, backtrace) {
this.echo("Error: " + msg, "ERROR");
@wolverian
wolverian / genbuffer.go
Created March 30, 2013 19:03
go-gl GenBuffer sigsegv
package main
import (
"github.com/go-gl/gl"
)
func main() {
buf := gl.GenBuffer()
println(buf)
}
@wolverian
wolverian / gist:5929197
Created July 4, 2013 17:18
brew doctor and config
iv@blindsight ~/plan9port> brew doctor
Warning: Experimental support for using Xcode without the "Command Line Tools".
You have only installed Xcode. If stuff is not building, try installing the
"Command Line Tools" package provided by Apple.
iv@blindsight ~/plan9port> brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 3a17f96c8f428a8de8c00b5c80e9f4c40fb19630
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
function! ToggleOnly()
let l:view = winsaveview()
if search("\\v( |^)(it|describe)", "b")
if search("\\.only", "c", line("."))
%s/\.only//g
else
let l:cur = getpos(".")
%s/\.only//ge
call setpos(".", l:cur)
#lang typed/racket
(define-type Tree (U leaf node))
(struct: leaf ([val : Number]))
(struct: node ([left : Tree] [right : Tree]))
(: tree-height (-> Tree Integer))
(define (tree-height t)
(match t
[(leaf v) 1]

Keybase proof

I hereby claim:

  • I am wolverian on github.
  • I am iviv (https://keybase.io/iviv) on keybase.
  • I have a public key whose fingerprint is 2CF2 46CE 4C7C ACB4 9D72 598C E8E8 7DDF 9926 4ACE

To claim this, I am signing this object:

#lang typed/racket
(define-syntax deftype
(syntax-rules ()
[(_ name [cons-name (field-name : field-type) ...] ...)
(begin
(struct cons-name ([field-name : field-type] ...) #:transparent) ...
(define-type name (U cons-name ...)))]))
(deftype arith-c
(: interp (Expr-C Env Store -> Result))
(define (interp expr env store)
(match expr
[(num-c n) (v*s (num-v n) store)]
[(plus-c l r) (match-let* ([(v*s v-l s-l) (interp l env store)]
[(v*s v-r s-r) (interp r env s-l)])
(v*s (num+ v-l v-r) s-r))]
[(mult-c l r) (match-let* ([(v*s v-l s-l) (interp l env store)]
[(v*s v-r s-r) (interp r env s-l)])
(v*s (num* v-l v-r) s-r))]
% find .
.
./build-jvm.clj
./build-lumo.cljs
./index.html
./src
./src/muse
./src/muse/core.cljs
% time java -cp /usr/local/Cellar/clojurescript/1.9.293/libexec/cljs.jar:src clojure.main build-jvm.clj

Keybase proof

I hereby claim:

  • I am wolverian on github.
  • I am iviv (https://keybase.io/iviv) on keybase.
  • I have a public key ASALcto8M5Gy3I7HpTlm1WLMktc43zUQ8zq1kJoylxinjQo

To claim this, I am signing this object: