Skip to content

Instantly share code, notes, and snippets.

Scott Watermasysk scottwater

Block or report user

Report or block scottwater

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
scottwater / secure_resqueue_server_1.rb
Created Apr 13, 2011
Quick samples on securing Resque::Server
View secure_resqueue_server_1.rb
require 'resque/server'
class SecureResqueServer < Resque::Server
before do
redirect '/' unless some_condition_is_met!
View backplan_api.rb
class BackplaneApi
include HTTParty
debug_output $stderr if Rails.env.development?
base_uri ''
basic_auth ENV['BACKPLANE_TOKEN'], ''
format :json
def add_route(pattern, labels={})
scottwater / segment.html
Created Feb 22, 2018
Sample KickoffLabs Segment Integration.
View segment.html
<script type="text/javascript">
var segment_api_key = 'YOUR KEY HERE';||([]),["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group","on","once","off"],{return function(){var;return t.unshift(a),,}};for(var i=0;i<;i++){var[i];[method]}{var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+""+a+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},"2.0.6",,;
scottwater / leaderboard_incognito.html
Last active Feb 21, 2018
Customize your LeaderBoard name list
View leaderboard_incognito.html
<script type="template" id="incognito_rows">
scottwater / form.html
Created Feb 21, 2014
How to collect emails for KickoffLabs with just a HTML Form (note the list id 1905 and return_url hidden input).
View form.html
<form class="form-inline" role="form" method="POST" action="">
<input type="hidden" name="return_url" value="">
<label for="email">Email address</label>
<input type="email" id="email" name="email" placeholder="Your Best Email Address">
<button type="submit">Sign Me Up</button>
scottwater / curl
Last active Sep 7, 2017
Quick KickoffLabs API
View curl
curl -d ''
curl -G -d ""
scottwater / push_bulk_in.rb
Created Mar 21, 2017
Sidekiq Push Bulk In
View push_bulk_in.rb
module Sidekiq
class Client
def self.push_bulk_in(interval, items)
int = interval.to_f
now =
ts = (int < 1_000_000_000 ? now + int : int)
items['at'.freeze] = ts if ts >= now
View aes_helper_old_monkey_patch.rb
module Keen
class AESHelperOld
def self.aes256_encrypt(key, plaintext, iv = nil)
padded_key = key
aes =, :CBC)
aes.key = padded_key
aes.iv = iv unless iv.nil?
scottwater / leaderboard.htm
Last active Mar 14, 2017
More Leads on the LeaderBoard
View leaderboard.htm
<!- Add this to the header HTML area of your KickoffLabs Landing Page ->
var kol_leader_board_options = {board_settings: {limit: 25}};
scottwater / backplane_health_check.rb
Last active Jan 24, 2017
Sample health check middleware for
View backplane_health_check.rb
class BackplaneHealthCheck
OK_RESPONSE = [ 200, { 'Content-Type' => 'text/plain' }, ['OK!'.freeze]]
def initialize(app)
@app = app
def call(env)
if env['HTTP_HOST'.freeze] == 'backend'.freeze && env['PATH_INFO'.freeze] == '/health'.freeze
You can’t perform that action at this time.