This file contains 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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
This file contains 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
{- shamir_threshold_scheme.hs | |
- | |
- My Haskell implementation of Shamir's (k, n) Threshold scheme. | |
- GRE, 6/23/11 | |
-} | |
import Data.Bits (shiftR, testBit) | |
import Data.List (foldl', nub) | |
import Random (mkStdGen, randomRs) |
This file contains 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
#you probably only need one of these, but here's the lot of them... | |
#prepare the commands that will bring the various browsers to the front | |
bring_chrome_to_front = %Q{ osascript -e "tell application \\\"Google Chrome\\\" to activate" } | |
bring_firefox_to_front = %Q{ osascript -e "tell application \\\"Firefox\\\" to activate" } | |
#execute the applescript commands to bring the browsers to the front | |
`#{bring_chrome_to_front}` | |
`#{bring_firefox_to_front}` |
This file contains 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 Fixnum | |
def seconds | |
self | |
end | |
def minutes | |
self * 60 | |
end | |
def hours |