Skip to content

Instantly share code, notes, and snippets.

function transform_payload(payload) {
var headers = {"content-type": "application/json",
"X-Insert-Key": "newrelic-insights-insert-api-key"};
var body = [{"eventType": payload["event"],
"timestamp": Date.parse(payload["timestamp"]),
"session_id": payload["session"]}];
return {"status": "ok", "headers": headers, "body": body};
}
@wkj
wkj / tddium.rake
Last active August 29, 2015 14:13 — forked from mattgibson/tddium.rake
# To set up:
#
# Add this file as /lib/tasks/tddium.rake
#
# Create an IAM user on AWS with no special policies, then add the access
# key and secret key to your Tddium suite config like this:
#
# cd /your/local/app/directory
# tddium config:add suite AWS_ACCESS_KEY yourkeyhere
# tddium config:add suite AWS_SECRET_KEY yoursecrethere
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
patch -p1 < no_sslv2.diff
cd ..
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
patch -p1 < no_sslv2.diff
cd ..
@wkj
wkj / gist:5058827
Created February 28, 2013 18:12 — forked from wkrsz/gist:2761871
# Setup:
# tddium config:add suite EY_API_TOKEN xxxxxxxx
# (take EY_API_TOKEN value from ~/.eyrc)
# tddium config:add suite EY_DEPLOY_KEY yyyyyyy
# (EY_DEPLOY_KEY value is Base64-encoded content of your ~/.ssh/id_rsa OR any other ssh key authorised for a given EY env)
require 'timeout'
require 'etc'
require 'base64'
@wkj
wkj / 0-readme.md
Created June 4, 2012 20:25 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@wkj
wkj / gem.rb
Created August 8, 2011 19:04
Build and install a gem for testing with Cucumber and Aruba
# Copyright 2011 Solano Labs All Rights Reserved
require 'aruba'
require 'aruba/api'
class CukeGem
@setup_done = false
class << self
include Aruba::Api
@wkj
wkj / tddium.rake
Created June 15, 2011 17:46
Tddium pre_hook and db_hook examples
namespace :tddium do
desc "tddium environment pre-run setup task"
task :pre_hook do
%w(tddium recurly pricing).each do |cfg|
system "cd config && ln -nfs #{cfg}.example.yml #{cfg}.yml"
end
end
desc "tddium environment db setup task"