Skip to content

Instantly share code, notes, and snippets.

View benfalk's full-sized avatar
🏠
Working from home

Benjamin Falk benfalk

🏠
Working from home
View GitHub Profile
class InterpreterFinder
extend MyFinder
attr_accessor :job_request
finds_interpreters :willing_to_travel_to, the_job_request(:physical_address)
finds_interpreters :available_on, the_job_request(:start_datetime)
finds_interpreters :with_gender, of_the_job_request(:gender_range)
finds_interpreters :not_blacklisted_by, the_job_request(:client)
@benfalk
benfalk / gist:5238909
Created March 25, 2013 17:30
How to use the paycom
require 'paycom'
login = Paycom::Login.new 'user_name', 'password', 'ssn_last_four_digits'
# This will fill out the week vanillia style
Paycom.week_punch login, Date.today
# This will fill out next week
Paycom.week_punch login, 1.week.from_now
class String
def is_anagram?(other)
length == other.length && byte_sum == other.byte_sum
end
def byte_sum
bytes.inject(:+)
end
@benfalk
benfalk / gist:5945631
Created July 8, 2013 01:24
Node.js Ubuntu Setup
If you're on Ubuntu Server, first do this:
sudo apt-get install python-software-properties
Then, do this:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
@benfalk
benfalk / gist:6001868
Last active December 19, 2015 18:49
Just playin
#!/usr/bin/env ruby
module DarkHorse
class << self
def included(base)
base.send(:extend, DarkHorse::SingletonMethods)
end
end
module TopSecret
def super_attr(attr)
value = nil
define_method "#{attr}" do
value
end
@benfalk
benfalk / gist:d362eaa786668cd8cbf8
Created June 14, 2014 01:44
lol air client version
4.9.14_05_28_22_32
@benfalk
benfalk / setup.sh
Last active August 29, 2015 14:05
Setup Ubuntu Work Station
# Base up and running...
sudo apt-get update -y
sudo apt-get install build-essential -y
sudo apt-get install cmake -y
sudo apt-get install python-software-properties -y
sudo apt-get install python-dev -y
sudo apt-get install curl -y
sudo apt-get install git -y
sudo apt-get install xclip -y
#!/usr/bin/env ruby
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => ":memory:"
)
#!/usr/bin/env ruby
require 'active_record'
require 'pstore'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => ":memory:"
)