I hereby claim:
- I am gary-rafferty on github.
- I am garyrafferty (https://keybase.io/garyrafferty) on keybase.
- I have a public key ASC_lZnNF4jt_GkZfKkoNxF4zDHiDF1Yy-Tp4moKzwf9Owo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def zerosum(arr,size=4) | |
arr.permutation(size).to_a.each do |a| | |
if a.inject(:+) == 0 | |
p a.inspect | |
break | |
end | |
end | |
end | |
zerosum([2,3,5,6,7,8,9,1,2,3,-1,-11,44,-1,0,1,1],5) |
function whenAvailable(name, callback) { | |
var interval = 10; | |
window.setTimeout(function() { | |
if(window[name]) { | |
callback(window[name]); | |
} else { | |
setTimeout(arguments.callee, interval); | |
} | |
}, interval); | |
} |
require 'exceptional' | |
require 'yaml' | |
Exceptional::Config.load("config/exceptional.yml") | |
@hash = {} | |
1.upto(50000) do |i| | |
@hash[i] = "email#{i}@domain.com" | |
end |
require 'sinatra/base' | |
require 'airbrake' | |
Airbrake.configure do |config| | |
config.api_key = 'YOUR-API-KEY-HERE' | |
config.host = 'api.airbrake.io' | |
end | |
class MyApp < Sinatra::Base | |
use Airbrake::Rack |
(function($){ | |
function getInternetExplorerVersion() { | |
var rv = -1; | |
if (navigator.appName == 'Microsoft Internet Explorer') { | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) | |
rv = parseFloat( RegExp.$1 ); | |
} | |
return rv; |
BASE_URL = "http://www.irishrail.ie/your_journey/ajax/ajaxRefreshResults.asp?station=" | |
trains = [] | |
station = URI.escape(params[:station]) | |
doc = Nokogiri::HTML(open("#{BASE_URL}#{station}")) | |
doc.search('tr').each {|t| trains << t if t.content =~ /DART/} |
require './application' | |
namespace :routes do | |
task :show do | |
endpoints = {} | |
if Sinatra::Application.descendants.any? | |
#Classic application structure | |
applications = Sinatra::Application.descendants | |
applications.each do |app| |
module Devise | |
module Orm | |
module MongoMapper | |
module Hook | |
def devise_modules_hook! | |
extend Schema | |
include Compatibility | |
yield | |
return unless Devise.apply_schema | |
devise_modules.each { |m| send(m) if respond_to?(m, true) } |