Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am izakp on github.
  • I am izakp (https://keybase.io/izakp) on keybase.
  • I have a public key ASCFjtzSelAy4QBsx_Tb6v463nOIf6kGvP6qlEiIxfqpcAo

To claim this, I am signing this object:

View clean-goreplay-logfile.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Cleans a https://goreplay.org/ log file of any requests containing the provided string.
Usage: python clean-goreplay-logfile.py {PATH_TO_LOGFILE} {CLEAN_STRING}
"""
import sys
import os
@izakp
izakp / gdp.json
Created Mar 24, 2017
Spark example dataset
View gdp.json
This file has been truncated, but you can view the full file.
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 36229613725.645, "Year": 1971}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 43135168196.5945, "Year": 1972}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 54780879976.0272, "Year": 1973}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 104523001271.412, "Year": 1974}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 115752821947.206, "Year": 1975}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 144057806919.486, "Year": 1976}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 165984443446.144, "Year": 1977}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 183528095316.993, "Year": 1978}
{"Country Name": "Arab World", "Country Code": "ARB", "Value": 247491798430.331, "Year": 1979}
View us-states.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
View us-states-migrations2012.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 56 columns, instead of 57. in line 1.
"Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia ","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"
"Alabama","N/A",1004,962,660,3077,1386,284,42,162,11244,19920,627,493,2722,1347,345,865,2495,3104,67,1513,334,2298,752,4952,1555,101,151,1009,161,1702,459,2709,5133,228,1411,459,2709,5133,228,1411,194,200,1837,0,2811,518,10539,7468,579,0,3170,1034,128,760,88
"Alaska",1097,"N/A",1520,196,3494,556,0,0,356,1991,928,1376,538,58,260,13,221,161,120,66,508,297,563,192,5
View -
session_ids = self.query_database[:events_master].where(:name => 'script.loaded', :source => 'tracker', :timestamp => period.range)
.exclude(:remote_ip => BLACKLIST_IPS).exclude(:pageview_id => self.embedded_pageview_ids(period)).distinct(:session_id)
.select_map(:session_id)
total_sessions = 0
session_ids.each do |session_id|
query = self.query_database[:events_master].where(:name => 'script.loaded', :source => 'tracker', :timestamp => period.range, :session_id => session_id)
events = query.order(:timestamp).all
View -
diff --git a/cookbooks/sensu/files/default/run-cron.rb b/cookbooks/sensu/files/default/run-cron.rb
index bfd0455..b9f3e95 100644
--- a/cookbooks/sensu/files/default/run-cron.rb
+++ b/cookbooks/sensu/files/default/run-cron.rb
@@ -5,6 +5,7 @@ require 'shellwords'
require 'redis'
require 'time'
require 'yaml'
+require 'sentry-raven'
View -
diff --git a/cookbooks/sensu/files/default/run-cron.rb b/cookbooks/sensu/files/default/run-cron.rb
index bfd0455..a5d8419 100644
--- a/cookbooks/sensu/files/default/run-cron.rb
+++ b/cookbooks/sensu/files/default/run-cron.rb
@@ -5,6 +5,7 @@ require 'shellwords'
require 'redis'
require 'time'
require 'yaml'
+require 'sentry-raven'
View -
diff --git a/cookbooks/apn_sender/recipes/default.rb b/cookbooks/apn_sender/recipes/default.rb
new file mode 100644
index 0000000..903aecc
--- /dev/null
+++ b/cookbooks/apn_sender/recipes/default.rb
@@ -0,0 +1,33 @@
+#
+# Cookbook Name:: resque
+# Recipe:: default
+#
View gist:9348709
window.console_log = function(message) {
if (typeof(console) !== "undefined") {
console.log(message);
}
}