Skip to content

Instantly share code, notes, and snippets.

View ssimeonov's full-sized avatar

Simeon Simeonov ssimeonov

View GitHub Profile
@ssimeonov
ssimeonov / tracking_pixel_delivery_script.js
Created April 17, 2013 02:21
Anatomy of an online ad: tracking pixel delivery script
document.write("<!-- gd2-status-2 --><!-- SpaceID=96843138 loc=FSRVY noad -->\n");
document.write("<img style=\"display:none\" width=0 height=0 alt=\"\" src=\"http://us.bc.yahoo.com/b?P=s4i.Bjc2LjFQGJ6UTYvtUx1LMTczLlFt_1n__8MU&T=18f3d55it%2fX%3d1366163289%2fE%3d96843138%2fR%3dhe%2fK%3d5%2fV%3d8.1%2fW%3d0%2fY%3dYAHOO%2fF%3d4264990850%2fH%3dYWRjdmVyPSI2LjQuNCIgc2VydmVJZD0iczRpLkJqYzJMakZRR0o2VVRZdnRVeDFMTVRjekxsRnRfMW5fXzhNVSIgc2l0ZUlkPSI0NDUzMDUxIiB0U3RtcD0iMTM2NjE2MzI4OTI1ODA1NyIg%2fQ%3d-1%2fS%3d1%2fJ%3d69060D4C&U=12d690f6l%2fN%3dlv51DmKImng-%2fC%3d-1%2fD%3dFSRVY%2fB%3d-1%2fV%3d0\"><!--QYZ CMS_NONE_SELECTED,,98.139.227.232;;FSRVY;96843138;2;-->");
@ssimeonov
ssimeonov / yahoo_ad_delivery_script.js
Created April 17, 2013 02:52
Anatomy of an online ad: ad delivery script
// This sets up AdChoice notice
document.write("<style type=\"text/css\">\n");
// AdChoice image: http://s.yimg.com/hl/a/optimized/adchoice_1.png
document.write(".can_ad_slug {font-family:arial;font-size:11px;color:#999;text-decoration:none;background-image:url(\'http://s.yimg.com/hl/a/optimized/adchoice_1.png\');background-repeat:no-repeat;background-position:right;padding:0px 14px 0px 1px !important;margin:1px 0px 1px 0;cursor:hand;height:12px;display:block;line-height:12px;}\n");
document.write(".ad_slug_table a {text-decoration:none;}\n");
document.write(".ad_slug_table div.CAN_marker { display:none }\n");
document.write("</style>\n");
document.write("<div class=\"CAN_ad\">\n");
document.write("<table class=\"ad_slug_table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n");
@ssimeonov
ssimeonov / google_ad_delivery_script.js
Created April 17, 2013 04:06
Anatomy of an online ad: Google ad delivery script
document.write('\x3c!-- Template Id \x3d 13,901 Template Name \x3d Banner Creative (Flash) - In Page Multiples - [DFA] --\x3e\n\x3c!-- Copyright 2006 DoubleClick Inc., All rights reserved. --\x3e\x3cscript src\x3d\x22http://s0.2mdn.net/879366/flashwrite_1_2.js\x22\x3e\x3c/script\x3e\n\x3cSCRIPT LANGUAGE\x3d\x22JavaScript\x22\x3e\n\x3c!--\nfunction DCFlash(id,pVM){\nvar swf \x3d \x22http://s0.2mdn.net/877848/CLB012__Hiking_728x90.swf\x22;\nvar gif \x3d \x22http://s0.2mdn.net/877848/Celebrex_728x90_Unbranded_Backup.3.11.13_1.gif\x22;\nvar minV \x3d 8;\nvar FWH \x3d \x27 width\x3d\x22728\x22 height\x3d\x2290\x22 \x27;\nvar url \x3d escape(\x22http://adclick.g.doubleclick.net/aclk?sa\x3dL\x26ai\x3dBkkTr1ABuUYnfKOz56AHh_4HQCbOj0YsDAAAAEAEgADgAUIC6g9b______wFYs4bGy0xgyYb2iISk7A-CARdjYS1wdWItNjc2MDQyMjg4NTEzMDEyMrIBGHd3dy5kY2xrLWRlZmF1bHQtcmVmLmNvbboBCWdmcF9pbWFnZcgBCdoBIGh0dHA6Ly93d3cuZGNsay1kZWZhdWx0LXJlZi5jb20vmAKIpAHAAgLgAgDqAi00Nzg4L2huLnVzLmhtbnloLmRpci54LngueC9DZWxlYnJleF9BcnRocml0aXP4AoHSHpAD4AOYA-ADqAMB4AQ
@ssimeonov
ssimeonov / google_ad_delivery.html
Created April 17, 2013 05:02
Anatomy of an online ad: Google/DoubleClick ad delivery
<!-- Template Id = 13,901 Template Name = Banner Creative (Flash) - In Page Multiples - [DFA] -->
<!-- Copyright 2006 DoubleClick Inc., All rights reserved. -->
<!-- Utilities for using Flash -->
<script src="http://s0.2mdn.net/879366/flashwrite_1_2.js">
</script>
<!-- Script to active Flash ad unit -->
<SCRIPT LANGUAGE="JavaScript">
<!--
mkdir ~/.wireshark/plugins && cd ~/.wireshark/plugins && curl -O https://raw.github.com/jzwinck/redis-wireshark/master/redis-wireshark.lua
1.9.3p392 :001 > r = Redis.new
=> #<Redis client v3.0.4 for redis://127.0.0.1:6379/0>
1.9.3p392 :002 > r.set("key:5", "\xad\xad")
=> "OK"
1.9.3p392 :003 > r.get("key:5")
=> "\xAD\xAD"
@ssimeonov
ssimeonov / chef_resource_rake.rb
Created June 18, 2013 22:40
Chef LWRP subclassing example: rake resource subclasses rvm_shell.
class Chef
class ResourceFactory
class Rake
def self.create(*args, &block)
register
Chef::Resource::Rake.new(*args, &block)
end
def self.register
@klass ||= begin
@ssimeonov
ssimeonov / 01_example.rb
Last active December 18, 2015 16:29
Generalized Chef LWRP subclassing and inheritance example. Chef::LWRPFactory will even generate ChefSpec matchers for new resources.
#
# Cookbook Name:: rake-chef
# Recipe:: spec
#
# Copyright (C) 2013 Swoop, Inc.
#
include_recipe 'rvm'
# rake subclasses rvm_shell LWRP
@ssimeonov
ssimeonov / bluepill_override.rb
Created June 26, 2013 03:04
This gist shows how to make the Bluepill Chef cookbook use rvm. The trick is to subclass the provider in the Bluepill LWRP and override shell_out! to make it use rvm_shell instead.
class BluepillOverride
def self.provider
Class.new(Chef::Provider::BluepillService) do
def shell_out!(*args)
args.each do |command|
rvm_shell "#{command}" do
code command
end
end
end
app.process("web-1") do |process|
process.start_command = "bundle exec thin start --ssl --ssl-verify --ssl-key-file web.key --ssl-cert-file web.pem -p 3000"
process.working_dir = working_dir
process.daemonize = true
process.environment = env
process.stop_signals = [:quit, 30.seconds, :term, 5.seconds, :kill]
process.stop_grace_time = 45.seconds
process.stdout = process.stderr = "log/web-1.log"