Skip to content

Instantly share code, notes, and snippets.

View aishfenton's full-sized avatar

Aish aishfenton

  • Netflix
  • San Francisco
View GitHub Profile
@aishfenton
aishfenton / Our encrypt method
Created February 22, 2011 01:41
Thinking behind possible way to encrypt info for vWork Customer Portal
require 'openssl'
require 'digest/sha1'
ENCRYPT_METHOD = "aes-256-cbc"
API_KEY = "YOUR_VWORKAPP_API_KEY"
# What you have to do
c = OpenSSL::Cipher::Cipher.new(ENCRYPT_METHOD)
c.encrypt
# your pass is what is used to encrypt/decrypt
@aishfenton
aishfenton / octane2_protocol.md
Created August 10, 2010 23:58
Starting to sketch our Octane2 protocol
@aishfenton
aishfenton / populate_jobs.rb
Created July 18, 2010 23:51
Populate 1000 load of vWork jobs for performance testing
ACCOUNT_ID = 2
NUMBER_OF_JOBS = 1_000
class PopulateJobs
def create_job(index)
job = @account.intervals.new(:name => "Job #{index}")
location = Location.new(:formatted_address => "12 Heather Street, Auckland, Parnell, New Zealand", :lat => 123.2342, :lng => 37.234232)
job.milestones.build({:location => location, :milestone_type => "Start", :sequence_order => 0, :planned_duration => 0})
ACCOUNT_ID = 2
NUMBER_OF_JOBS = 1_000
class PopulateJobs
def create_job(index)
job = @account.intervals.new(:name => "Job #{index}")
location = Location.new(:formatted_address => "12 Heather Street, Auckland, Parnell, New Zealand", :lat => 123.2342, :lng => 37.234232)
@aishfenton
aishfenton / serializer_benchmarks.rb
Created July 18, 2010 02:32 — forked from visfleet/performance_of_yaml_vs_marshal.rb
Performance comparison of different ruby serializer methods
# sudo gem install bson
# sudo gem install bson_ext
# sudo gem install yajl-ruby
# sudo gem install json
# sudo gem install msgpack
require 'rubygems'
require 'benchmark'
require 'yaml'
require 'bson'
require 'rubygems'
require "builder"
require "benchmark"
require 'nokogiri'
require 'erb'
require 'erubis'
ITERATIONS = 1_000
ERB_TEMPLATE = <<-EOL