A collection of Splunk recipes for Heroku logs. Instructions for setting up Splunk Storm with Heroku can be found here. For the vast majority of these recipes you'll need to have enabled the Heroku labs feature, log-runtime-metrics, for your application.
class Inspector | |
# :nodoc: | |
def self._collect_events_for_method_call(&block) | |
events = [] | |
set_trace_func lambda { |event, file, line, id, binding, classname| | |
events << { :event => event, :file => file, :line => line, :id => id, :binding => binding, :classname => classname } | |
} | |
require 'benchmark' | |
Benchmark.bmbm do |x| | |
x.report "double quotes" do | |
10_000_000.times do | |
"foo" | |
end | |
end | |
x.report "single quotes" do | |
10_000_000.times do |
Here at PyData NYC, I heard a tutorial of how to use numpy and iPython notebooks. In a previous gist, I wrote drew all the zip codes of the Bronx in d3.js
This would be great for reproducing inforgraphics like Educational Attainment in New York City -- Brooklyn which looks a bit like a jigsaw puzzle:
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
# This is a simplified version of what we're using in production for drinksoma.com | |
namespace :mosql do | |
task :run => :environment do | |
conf_path = Rails.root.join('config', 'collections.yml') | |
cmd = "mosql -c #{conf_path} --sql #{ENV['MOSQL_POSTGRES_URI']} --mongo #{ENV['MOSQL_MONGO_URI']}" | |
IO.popen(cmd) do |child| | |
trap('TERM') { Process.kill 'INT', child.pid } | |
$stdout.sync = true |
# Install Git needed for Git based gems | |
packages: | |
yum: | |
git: [] | |
This gist started with a collection of resources I was maintaining on stream data processing — also known as distributed logs, data pipelines, event sourcing, CQRS, and other names.
Over time the set of resources grew quite large and I received some interest in a more guided, opinionated path for learning about stream data processing. So I added the reading list.
Please send me feedback!
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
container_commands: | |
sync_db: | |
command: "docker run --env DATABASE_URL=`/opt/elasticbeanstalk/bin/get-config environment | jq -r .DATABASE_URL` aws_beanstalk/current-app:latest lein lobos migrate" | |
leader_only: true |