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
scottwater / lb.html
Last active Jun 12, 2019
Add this to the header of a KickoffLabs thank you page (until there is UI to make this setting)
View lb.html
<script>
window.kol_leader_board_options = {
board_settings: {
lead_description: 'full_name'
}
}
</script>
View lb.html
<script>
window.kol_leader_board_options = {
board_settings: {
lead_description: 'full_name'
}
}
</script>
@scottwater
scottwater / page.html
Created Apr 15, 2019
AnyForm Custom Callback
View page.html
<script>
var kol_widget_options = {
callback: function(data) {
if (data.counter == 1) {
window.location = `https://YOURSITE.com?kid=${data.social_id}`;
} else {
window.location = data.redirect_url;
}
}
};
@scottwater
scottwater / index.js
Created Mar 27, 2019
Heroku/Fly SSL Proxy
View index.js
import { proxy } from "@fly/cdn"
import { httpsUpgrader } from "@fly/cdn/lib/middleware"
const origin = proxy("https://YOURAPP.herokuapp.com", {
headers: { host: "YOURAPP.herokuapp.com" }
})
const router = httpsUpgrader(origin)
fly.http.respondWith(router)
View backplan_api.rb
class BackplaneApi
include HTTParty
debug_output $stderr if Rails.env.development?
base_uri 'www.backplane.io:443'
basic_auth ENV['BACKPLANE_TOKEN'], ''
format :json
def add_route(pattern, labels={})
@scottwater
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';
window.analytics||(window.analytics=[]),window.analytics.methods=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group","on","once","off"],window.analytics.factory=function(a){return function(){var t=Array.prototype.slice.call(arguments);return t.unshift(a),window.analytics.push(t),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var method=window.analytics.methods[i];window.analytics[method]=window.analytics.factory(method)}window.analytics.load=function(a){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+a+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},window.analytics.SNIPPET_VERSION="2.0.6",
window.analytics.load(segment_api_key),
window.analytics.page();
</scr
View aes_helper_old_monkey_patch.rb
module Keen
class AESHelperOld
def self.aes256_encrypt(key, plaintext, iv = nil)
puts 'IN DA MONKEY PATCH!'
padded_key = key
aes = OpenSSL::Cipher::AES.new(256, :CBC)
aes.encrypt
aes.key = padded_key
aes.iv = iv unless iv.nil?
@scottwater
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 = Time.now.to_f
ts = (int < 1_000_000_000 ? now + int : int)
items['at'.freeze] = ts if ts >= now
push_bulk(items)
end
@scottwater
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 ->
<script>
var kol_leader_board_options = {board_settings: {limit: 25}};
</script>
@scottwater
scottwater / sample.html
Last active Jul 20, 2018
KickoffLabs Known Lead Event
View sample.html
<script>
$(document).ready(function() {
$(document).on('kol:knownlead', function(e, lead){
var social_id = lead.id;
});
});
</script>
You can’t perform that action at this time.