This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # this script is pretty shit, really, but if you switch it to delete it's an easy way to | |
| # blast through your texts and clean up your inbox. the problem with it is that gvoice | |
| # can get into an inconsistent state after about a dozen pages. | |
| require 'rubygems' | |
| require 'selenium-webdriver' | |
| def signin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn ignored? [classname] | |
| (let [ignored #{"callers" "dbg" "clojure.lang" "swank" "eval"}] | |
| (some #(s/substring? % classname) ignored))) | |
| (defn callers [] | |
| (let [fns (map #(str (.getClassName %)) | |
| (-> (Throwable.) .fillInStackTrace .getStackTrace))] | |
| (vec (doall (remove ignored? fns))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn append [list1 list2] | |
| (if (empty? list1) | |
| list2 | |
| (cons (first list1) (append (rest list1) list2)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ThreadTest < Test::Unit::TestCase | |
| # ~ 340 microseconds per thread spin-up, regardless of `-J-Djruby.thread.pooling=[true|false]' | |
| def test_some_speeds | |
| @runs = 0 | |
| def func | |
| @runs += 1 | |
| end |
NewerOlder