Skip to content

Instantly share code, notes, and snippets.

View will's full-sized avatar
🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈

Will Leinweber will

🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈
View GitHub Profile
''=~( '(?{' .('`' |'%') .('[' ^'-')
.('`' |'!') .('`' |',') .'"'. '\\$'
.'==' .('[' ^'+') .('`' |'/') .('['
^'+') .'||' .(';' &'=') .(';' &'=')
.';-' .'-'. '\\$' .'=;' .('[' ^'(')
.('[' ^'.') .('`' |'"') .('!' ^'+')
.'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.'
).(('`')| '/').').' .'\\"'.+( '{'^'['). ('`'|'"') .('`'|'/'
).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\\".\\"'.( '['^('(')).
'\\"'.('['^ '#').'!!--' .'\\$=.\\"' .('{'^'['). ('`'|'/').( '`'|"\&").(
@will
will / dropbox
Created September 5, 2010 17:34
my dropbox link http://db.tt/K4wVxMv
module AuthlogicModel
def self.included(model)
model.class_eval do
extend ClassMethods
include InstanceMethods
include ProtectedAttributes
field :username
field :email
field :crypted_password
require 'rubygems'
if ARGV[0] == 'old'
puts 'beta7'
gem 'couchrest_model', '1.0.0.beta7'
require 'couchrest_model'
else
puts 'head'
$:.unshift 'lib'
require File.join(File.dirname(__FILE__),'lib', 'couchrest_model')
@will
will / a.clj
Created December 7, 2010 03:27
null pointer exception
; no more null pointer :)
(use 'clojure.set)
(def tens (range 1 10))
(def ones (range 0 10))
(defn combine [a b] (+ (* 10 a) b))
(defn uniq [a b n] (if (= a n) b a))
(defn safed [a b] (if (zero? b) 0 (/ a b)))
(def answers
@will
will / euler38.clj
Created December 11, 2010 05:36
euler38.clj
(defn split [n]
(cond
(< n 10) [n]
:else (conj
(split (quot n 10))
(rem n 10))))
(defn join [numbers]
(reduce
#(+ (* 10 %1) %2)
;; this one correctly memoizes all the recursive calls
;(defn next-chain [n] a-new-number)
(def chain-ends nil)
(defn get-ans [n] (chain-ends n))
(def get-ans (memoize get-ans))
(defn chain-ends [n]
2011-06-22T06:35:27+00:00 heroku[worker.1]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.2]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.3]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.4]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.5]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.7]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.8]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.9]: State changed from created to starting
2011-06-22T06:35:27+00:00 heroku[worker.10]: State changed from created to starting
2011-06-22T06:35:28+00:00 heroku[worker.11]: State changed from created to starting
@will
will / 4bit_b.png
Created June 28, 2011 08:31
codebrawl2
4bit_b.png
@will
will / Readme.md
Created July 10, 2011 01:09
Classy

Classy — Class Testing

   classy is simple
no setup or descriptions
    just equality

(ruby 1.9 only, probably)

test.rb