TCP socket connection with TLS.
Uses JSON to represent the message (http://en.wikipedia.org/wiki/JSON).
{
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 |
TCP socket connection with TLS.
Uses JSON to represent the message (http://en.wikipedia.org/wiki/JSON).
{
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) |
# 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 |