Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am laod on github.
  • I am houshja (https://keybase.io/houshja) on keybase.
  • I have a public key whose fingerprint is 076E EF87 49FB 0F08 DE47 21C8 3D37 C167 A358 169A

To claim this, I am signing this object:

@laod
laod / o5-2.html
Last active December 15, 2015 12:28
Experiments with three.js. Horrible hacks.
<html>
<head>
<title>Experiment 6</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="coffee-script.js"></script>
<script src="underscore.js"></script>
<script src="three.js"></script>
@laod
laod / config.ru
Last active December 14, 2015 14:18
Opal fun - Opal::Server version: config.ru that made the current version of opal work for me. Put your files (whatever.js.opal or whatever.js.rb) in the assets directory. Change s.main to the name of the appropriate js.opal file. rackup. Enjoy. Some parts may be redundant. Investigating. Non-server version: convert.rb
require 'opal'
run Opal::Server.new { |s|
s.main = 'doi'
e = s.sprockets
e.append_path 'assets'
}
@laod
laod / medicat.rb
Last active December 14, 2015 06:29
Code snippet from a ruby project that maps data from our directories and sis warehouse to csv
#!/usr/bin/ruby
require 'ldap'
require 'pg'
require 'csv'
# because empty isn't false, that's why
class String
def presence
self.empty? ? nil : self
@laod
laod / raskell.rb
Created August 16, 2012 15:34 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@laod
laod / tv2.sql
Created August 9, 2012 14:36
We don't need no steenking pivot
create temp view tv2 as select
b.did as id,
(select a.value from namevalue as a where a.name='first' and
a.did=b.did) as first,
(select a.value from namevalue as a where a.name='last' and
a.did=b.did) as last,
(select a.value from namevalue as a where a.name='uid' and
a.did=b.did) as uid,
(select a.value from namevalue as a where a.name='displayname' and
a.did=b.did) as displayname,
@laod
laod / headspace.clj
Created August 5, 2012 04:28
Watch me publicly fail at clojure
(ns headspace.core
(:use noir.core
korma.db
korma.core
clojure.pprint)
(:require [noir.server :as server]
[noir.response :as response]
[clojure.string :as string]
[net.cgrand.enlive-html :as h])
(:import java.net.URL))