Skip to content

Instantly share code, notes, and snippets.

View lgsunnyvale's full-sized avatar

Josh Guo lgsunnyvale

  • Bay Area, California
View GitHub Profile
@Kimtaro
Kimtaro / gist:1779371
Created February 9, 2012 11:18
Installing the wordnet gem on OSX, as of February 9 2012

Getting the wordnet gem, version 0.0.5, working is a little tricky at the moment. It's being rewritten but isn't released yet and the dbd gem is in a similar state.

These steps got it working for me on OS X Lion and MRI 1.8.7. On 1.9.2 convertdb.rb segfaults.

WordNet

Download WordNet from http://wordnet.princeton.edu/wordnet/download/current-version/

$ ./configure
@sjl
sjl / giver.clj
Created August 14, 2011 21:54
Clojurecraft Givebot
(ns bots.giver
(:require (clojure.contrib [string :as s]))
(:require (clojurecraft [core :as core]
[actions :as actions]
[events :as events])))
(def item-map {"tnt" "46", "lever" "69"})
(def WANT-RE #"^<(\w+)> i want (\d+)? ?(.+)?$")
@ithayer
ithayer / create-heroku
Created July 4, 2011 19:20
Clojure on Heroku with Noir and Mongo Demo
# Commands to initialize a simple heroku noir app. You can cut and paste them together.
# Install latest version of noir. If an older version is installed, remove it first.
lein plugin install lein-noir "1.1.0-SNAPSHOT"
# Create new noir project.
lein noir new noir-mongo-heroku
cd noir-mongo-heroku
# Create instructions for heroku.
echo 'web: lein run' > Procfile
# Create git repository.
@francescoagati
francescoagati / attr_accessor.coffee
Created July 3, 2011 21:05
a simple getter and setter in coffeescript mimic attr_accessor of ruby (monkey patching version)
Object::attr_accessor= (prop) ->
self=@
self["_#{prop}"]=null
self[prop]=(value) ->
@["_#{prop}"]=value if value?
@["_#{prop}"]
Player={}