TCP socket connection with TLS.
Uses JSON to represent the message (http://en.wikipedia.org/wiki/JSON).
{
require 'rubygems' | |
require "builder" | |
require "benchmark" | |
require 'nokogiri' | |
require 'erb' | |
require 'erubis' | |
ITERATIONS = 1_000 | |
ERB_TEMPLATE = <<-EOL |
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) |
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}) |
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 |
require 'eventmachine' | |
require 'evma_httpserver' | |
class MyHttpServer < EventMachine::Connection | |
include EventMachine::HttpServer | |
def post_init | |
super | |
ssl_dir = File.join(File.dirname(__FILE__), "ssl") | |
server_key = File.join(ssl_dir, "server.key") |
require "benchmark" | |
require "mongoid" | |
require "bloomfilter-rb" | |
module BloomFilter | |
class Native | |
def self.unpack(str) | |
bitstring = str.unpack("B*").first | |
bytes = [] |
// ------------------------------------------------------------------------------------------------------------------// | |
// vWorkApp Core Library | |
// ------------------------------------------------------------------------------------------------------------------// | |
var vWorkAppScript = vWorkAppScript || {}; | |
vWorkAppScript.host = "api.vworkapp.com"; | |
vWorkAppScript.apiToken = "PUT YOUR API KEY HERE" | |
(function() { |
body { | |
font-family: sans serif; | |
background-color: white; | |
font-family: georgia; | |
font-size: 15px; | |
margin: 20px; | |
} | |
ul { | |
list-style-type: square; |
#!/usr/bin/env awk -f | |
BEGIN { | |
SEP="\t" | |
FS="\"" SEP "\"|^\""; | |
} | |
{ | |
out=$2; | |
for (i=3;i<=NF-1;i++) { | |
gsub(/\t/, "_", $i); |