Skip to content

Instantly share code, notes, and snippets.

View drewdeponte's full-sized avatar

Drew De Ponte drewdeponte

View GitHub Profile
322 function! DrewRunTests(filename)
323 :w
324 let winnr = bufwinnr('^_drew_run_tests_output$')
325 if ( winnr >= 0 )
326 execute winnr . 'wincmd w'
327 setlocal modifiable
328 execute 'normal ggdG'
329 else
330 botright new _drew_run_tests_output
331 setlocal modifiable
@drewdeponte
drewdeponte / gist:3420790
Created August 22, 2012 00:23
Require inside module try #1
module MyModule
require 'event_types'
end
@drewdeponte
drewdeponte / gist:3420782
Created August 22, 2012 00:22
What I want it to be like
module MyModule
module Scope
# The message is intended for the advertiser.
ADVERTISER = 0
# The message is intended for the logged-in business user.
BUSINESSUSER = 1
# The message is intended for the business.
BUSINESS = 2
# The message is intended for the co-brand.
COBRAND = 3
@drewdeponte
drewdeponte / event_types.rb
Created August 22, 2012 00:20
Thrift auto generated event types file.
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
require 'exception_types'
require 'shared_types'
@drewdeponte
drewdeponte / gist:3364584
Created August 15, 2012 23:15
base64 decoded byte array
["\x18", "\x05", "EMAIL", "\x15", "\x00", "\x18", "\x06", "106547", "\x16", "\x80\x8A\xC5\x88\xDAL", "\x18", "%", "[\"RATE\",\"ADD_TO_CONTACTS\",\"ADD_NOTE\"]", "\x18", "\x06", "865325", "\x18", "'", "Pain Center Austin - Search August 2011", "\e", "\x1C", "\x88", "\x06", "region", "\x02", "OH", "\x0F", "etsReferrerType", "\x00", "", "\x04", "dbId", "\b", "10041829", "\x0F", "touchedByMonkey", "\x04", "true", "\b", "hashCode", "\x16", "TdOW8b51VpQ6r4miHiX6dg", "\x04", "city", "\n", "Youngstown", "\f", "touchedByEts", "\x05", "false", "\b", "division", "\v", "advertising", "\v", "phoneNumber", "\f", "512-422-3321", "\a", "eventId", "\b", "10041829", "\x02", "tc", "\x11", "11100412581916327", "\f", "userLocation", "\x10", "Youngstown,OH,US", "\x10", "Campaign Country", "\x03", "USA", "\t", "offerName", "\x17", "Search Engine Marketing", "\a", "offerId", "\x01", "1", "\f", "campaignType", "\x01", "1", "\x10", "masterCampaignId", "\x06", "761212", "\x0E", "contactCreated", "\x00", "", "\v", "targetEmail", "\x19",
@drewdeponte
drewdeponte / gist:3364569
Created August 15, 2012 23:12
ActiveMQ Admin Representation of the encoded event message.
RLEvent(eventType:EMAIL, scope:ADVERTISER, scopeId:106547, occurTime:1317758608000, actions:["RATE","ADD_TO_CONTACTS","ADD_NOTE"], campaignId:865325, campaignName:Pain Center Austin - Search August 2011, data:{region=OH, etsReferrerType=, dbId=10041829, touchedByMonkey=true, hashCode=TdOW8b51VpQ6r4miHiX6dg, city=Youngstown, touchedByEts=false, division=advertising, phoneNumber=512-422-3321, eventId=10041829, tc=11100412581916327, userLocation=Youngstown,OH,US, Campaign Country=USA, offerName=Search Engine Marketing, offerId=1, campaignType=1, masterCampaignId=761212, contactCreated=, [email protected], campaignCountry=USA, [email protected], eventRating=, country=US, senderName=Joyce Laviolette, campaignSubType=4, universalIp=3489692152, eventTime=2011-10-04 13:03:28.0, eventComments=}, eventKey:USA_ADVERTISER_106547_EMAIL_9223370692574026546_-9721, fromId:messageMonkey, operationType:, subType:RLEvent, source:platform, cassandraInsertTime:1344280749261, platform:USA, glob
@drewdeponte
drewdeponte / gist:3364558
Created August 15, 2012 23:10
Received jms-map-json transformed message from ActiveMQ using Stomp.
{"com.reachlocal.thrift.rlevent.RLEvent":{"@serialization":"custom","com.reachlocal.thrift.rlevent.RLEvent":{"byte-array":["GA==","BQ==","RU1BSUw=","FQ==","AA==","GA==" ,"Bg==","MTA2NTQ3","Fg==","gIrFiNpM","GA==","JQ==","WyJSQVRFIiwiQUREX1RPX0NPTlRBQ1RTIiwiQUREX05PVEUiXQ==","GA==","Bg==","ODY1MzI1","GA==","Jw==","UGFpbiBDZW50ZXIgQXVzdG luIC0gU2VhcmNoIEF1Z3VzdCAyMDEx","Gw==","HA==","iA==","Bg==","cmVnaW9u","Ag==","T0g=","Dw==","ZXRzUmVmZXJyZXJUeXBl","AA==","","BA==","ZGJJZA==","CA==","MTAwNDE4Mjk=","Dw ==","dG91Y2hlZEJ5TW9ua2V5","BA==","dHJ1ZQ==","CA==","aGFzaENvZGU=","Fg==","VGRPVzhiNTFWcFE2cjRtaUhpWDZkZw==","BA==","Y2l0eQ==","Cg==","WW91bmdzdG93bg==","DA==","dG91Y2h lZEJ5RXRz","BQ==","ZmFsc2U=","CA==","ZGl2aXNpb24=","Cw==","YWR2ZXJ0aXNpbmc=","Cw==","cGhvbmVOdW1iZXI=","DA==","NTEyLTQyMi0zMzIx","Bw==","ZXZlbnRJZA==","CA==","MTAwNDE4M jk=","Ag==","dGM=","EQ==","MTExMDA0MTI1ODE5MTYzMjc=","DA==","dXNlckxvY2F0aW9u","EA==","WW91bmdzdG93bixPSCxVUw==","EA==","Q2FtcGFpZ24gQ291bnRyeQ==","Aw==","VVNB
NameVirtualHost 127.0.0.1:80
NameVirtualHost 127.0.0.1:443
Listen *:443
LoadModule passenger_module /Users/adeponte/.rvm/gems/ruby-1.9.3-p125@rpp_web_app/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /Users/adeponte/.rvm/gems/ruby-1.9.3-p125@rpp_web_app/gems/passenger-3.0.11
PassengerRuby /Users/adeponte/.rvm/wrappers/ruby-1.9.3-p125@rpp_web_app/ruby
PassengerMaxPoolSize 2
@drewdeponte
drewdeponte / rpp_test_job.rb
Created July 24, 2012 00:24
OctpusCI example job
class RppTestJob < Octopusci::Job
def self.run(job_rec)
context "RSpec Tests (commit)" do
run_shell_cmd!("env 2>&1", true)
run_shell_cmd!("whoami 2>&1", true)
run_shell_cmd!("rvm rvmrc trust 2>&1")
run_shell_cmd!("rvm rvmrc load 2>&1")
run_shell_cmd!("bundle install 2>&1", true)
run_shell_cmd!("STAGE=#{job_rec['stage']} REPO_OWNER=#{job_rec['repo_owner_name']} bundle exec cap deploy:setup 2>&1", true)
run_shell_cmd!("STAGE=#{job_rec['stage']} REPO_OWNER=#{job_rec['repo_owner_name']} bundle exec cap deploy:cleanup 2>&1", true)
@drewdeponte
drewdeponte / gist:2482238
Created April 24, 2012 18:14
ranged rebase
Here is how you would transplant a topic branch based on one branch to another, to pretend that you forked the topic branch from
the latter branch, using rebase --onto.
First let's assume your topic is based on branch next. For example, a feature developed in topic depends on some functionality
which is found in next.
o---o---o---o---o master
\
o---o---o---o---o next
\