I hereby claim:
- I am rfunduk on github.
- I am rfunduk (https://keybase.io/rfunduk) on keybase.
- I have a public key whose fingerprint is EB86 FA23 F865 B131 AD30 4776 92D1 8F10 1C51 9B64
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| import Darwin | |
| extension Array { | |
| func shuffle() -> Array { | |
| // this will sometimes crash (submitted bug #17127524) | |
| self.sort { _,_ in arc4random_uniform(2) == 1 } | |
| return self | |
| } | |
| mutating func removeAtIndexes( indexes:Int... ) { | |
| indexes.sort(>) |
| # Throttled Input event | |
| # | |
| #= provides throttled:input | |
| # | |
| #= require jquery | |
| # | |
| # Delays firing `input` event until user is done typing. | |
| # | |
| # ### Events | |
| # |
| tell application "Flint" to activate -- needs to be in front | |
| tell application "System Events" to tell application process "Flint" | |
| try | |
| get properties of window 1 | |
| set size of window 1 to {700, 800} | |
| set position of window 1 to {1700, 300} | |
| end try | |
| end tell | |
| tell application "Adium" to activate -- needs to be in front |
| #!/usr/bin/env ruby | |
| class Integer | |
| def to_roman_numerals | |
| num = self | |
| map = { | |
| 1 => 'I', | |
| 5 => 'V', | |
| 10 => 'X', |
| ;;; DECK | |
| (ns card-game.deck) | |
| (defn create [] | |
| (shuffle [:h2 :h3 :h4 :h5 :h6 :h7 :h8 :h9 :h0 :hj :hq :hk :ha | |
| :d2 :d3 :d4 :d5 :d6 :d7 :d8 :d9 :d0 :dj :dq :dk :da | |
| :s2 :s3 :s4 :s5 :s6 :s7 :s8 :s9 :s0 :sj :sq :sk :sa | |
| :c2 :c3 :c4 :c5 :c6 :c7 :c8 :c9 :c0 :cj :cq :ck :ca]) | |
| ) |
| (ns fizzbuzz.core (:gen-class)) | |
| (use '[clojure.string :only [blank? capitalize]]) | |
| ; a macro which expands (fbfn name M) to a function of one | |
| ; argument N which outputs "Name" if N % M == 0, otherwise "" | |
| (defmacro fbfn [name test] | |
| `(fn [arg#] (if (zero? (mod arg# ~test)) | |
| ~(capitalize (str name)) "")) | |
| ) |
| #!/usr/bin/env ruby | |
| # autoshot.rb | |
| # | |
| # Ryan Funduk (ryanfunduk.com) | |
| # Licensed under WTFPL (http://sam.zoy.org/wtfpl) | |
| # | |
| # Watch a directory and scp new files to a host that | |
| # is running a webserver. Only works on OSX, could be | |
| # made to work on other platforms with alternatives |
| The Regex Game | |
| Avi Bryant | |
| This is a game for two programmers, although it's easy to imagine variations for more. | |
| It can be played over email, twitter, or IM, but it's easy to imagine a custom web app for it, and I encourage someone to build one. | |
| Each player starts by thinking of a regular expression. The players should decide beforehand on dialect and length restrictions (eg, has to be JavaScript-compatible and under 20 characters). | |
| They don't reveal the Regex, but if playing over email etc, should send each other a difficult to brute force hash (eg bcrypt) of the Regex for later verification. | |
| They do reveal two strings: one which the Regex will match, and one which it will not. |
| # SHUT UP with the "GET /assets/whatever..." in the log. Do not want. | |
| if Rails.env.development? | |
| Rails::Rack::Logger.class_eval do | |
| def call_with_quiet_assets(env) | |
| previous_level = Rails.logger.level | |
| Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
| call_without_quiet_assets(env).tap do | |
| Rails.logger.level = previous_level | |
| end | |
| end |