Skip to content

Instantly share code, notes, and snippets.

View j0ni's full-sized avatar
🌑
Off-world

Jon Levin j0ni

🌑
Off-world
View GitHub Profile
@j0ni
j0ni / am-error
Created June 5, 2011 20:02
ActiveMerchant load error message in rails 3.0.7
/Users/joni/Scratch/ruby/rails/fraz/vendor/ruby/1.8/gems/active_merchant-1.5.2/lib/active_merchant/lib/validateable.rb:31: uninitialized constant ActiveMerchant::Validateable::HashWithIndifferentAccess (NameError)
from /Users/joni/Scratch/ruby/rails/fraz/vendor/ruby/1.8/gems/active_merchant-1.5.2/lib/active_merchant.rb:33:in `require'
from /Users/joni/Scratch/ruby/rails/fraz/vendor/ruby/1.8/gems/active_merchant-1.5.2/lib/active_merchant.rb:33
from /Users/joni/.rvm/gems/ree-1.8.7-2011.03@global/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
from /Users/joni/.rvm/gems/ree-1.8.7-2011.03@global/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
from /Users/joni/.rvm/gems/ree-1.8.7-2011.03@global/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `each'
from /Users/joni/.rvm/gems/ree-1.8.7-2011.03@global/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `require'
from /Users/joni/.rvm/gems/ree-1.8.7-2011.03@global/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `each'
from /Users/joni/.rv
@j0ni
j0ni / netfirms-sopa
Created December 23, 2011 20:31
Note from netfirms.ca
Jonathan,
Thank you for your inquiry about our stance on SOPA.
While Netfirms is committed to the protection of intellectual property, we have serious concerns over the implications that this bill could have on free speech and the potential negative
effects on e-commerce. Therefore, we cannot support SOPA in its current form.
Best regards and Happy Holidays,
Gary R. Engel
@j0ni
j0ni / gist:1552453
Created January 2, 2012 22:41
rest resource macro
(ns j0ni.whatever
(:use compojure.core))
(defmacro explode-resource [rsrc controller-fn attrs]
`(context ~(str "/" rsrc) []
(GET "/"
[]
(~(symbol (controller-fn "index"))))
(GET "/new"
@j0ni
j0ni / brew --config output
Created July 3, 2012 17:18
failed homebrew emacs installation
13:08:06 naga ~/.../Code/github/cs-events git master$ brew --config
HOMEBREW_VERSION: 0.9.1
HEAD: 3537b74223d6bbef128f9135197c0901576d7c3a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: 4.3.0.0.1.1249367152
GCC-4.0: N/A
@j0ni
j0ni / _rake.zsh
Created November 23, 2012 00:04
Patched _rake definition for zsh
#compdef rake
# rake, version 0.8.3
local curcontext="$curcontext" state line expl ret=1
typeset -A opt_args
_arguments -C -s -S \
'(--classic-namespace -C)'{--classic-namespace,-C}'[put Task and FileTask in the top level namespace]' \
'(--dry-run -n)'{--dry-run,-n}'[do a dry run without executing actions]' \
@j0ni
j0ni / .zshrc
Last active June 2, 2016 00:36
Some zsh setup
# list possibles on first completion attempt
setopt AUTO_LIST
# cycle through the choices after that
setopt AUTO_MENU
# keep timestamps
setopt EXTENDED_HISTORY
# use OS file locking
@j0ni
j0ni / One.java
Last active December 10, 2015 00:28
public class One {
protected String arg;
public One(String arg) {
this.arg = arg;
}
}
@j0ni
j0ni / gist:6477035
Last active December 22, 2015 13:08
testing out the power of hoisting - turns out (obviously in retrospect) the continuation function isn't evaluated at code load time, so you have to run the printList function before the printItem function is available externally.
/*global exports, module*/
exports = module.exports = (function () {
var api = {};
api.printList = function () {
['hello', 'mr', 'smarty', 'pants'].forEach(api.printItem = function (i) {
console.log(i);
});
};
@j0ni
j0ni / error message
Last active August 29, 2015 14:02
Error compiling clojure against capacitor with conflicting core.async depency
CompilerException java.lang.Exception: namespace 'clojure.core.async.impl.channels' not found, compiling:(clojure/core/async.clj:9:1)
@j0ni
j0ni / core.clj
Last active August 29, 2015 14:02
Boggle solver
(ns interview1.core
(:require [clojure.set :as set]
[clojure.string :as string])
(:gen-class))
(def dice ["AAEEGN"
"ELRTTY"
"AOOTTW"
"ABBJOO"