Skip to content

Instantly share code, notes, and snippets.

# A program that works jobs in newly created UNIX
# process by calling fork. The number of processes
# running at any given time is bounded by our use
# of a sized queue.
require 'thread'
# Run at most 4 UNIX processes for any given time.
@limiter = SizedQueue.new(4)
@ryansmith3136
ryansmith3136 / l2met-dashboard.yml
Created August 7, 2013 01:35
Librato Dashboard Creator
---
l2met:
default-attributes:
type: gauge
aggregate: true
http.throughput:
http.accept:
summarize_function: sum
group_function: sum
summary_function: count
@ryansmith3136
ryansmith3136 / new.txt
Last active December 21, 2015 02:29
Runtime Metrics Changes
source=web.1 dyno=heroku.2808254.d97d0ea7-cf3d-411b-b453-d2943a50b456 sample#load_avg_1m=2.46 sample#load_avg_5m=1.06 sample#load_avg_15m=0.99
source=web.1 dyno=heroku.2808254.d97d0ea7-cf3d-411b-b453-d2943a50b456 sample#memory_total=21MB sample#memory_rss=21.22MB sample#memory_cache=0.00MB sample#memory_swap=0.00MB sample#memory_pgin=348836pages sample#memory_pgout=343403pages
@ryansmith3136
ryansmith3136 / Dockerfile
Last active December 13, 2016 10:48
EC2 Docker Setup
FROM ubuntu
MAINTAINER "Bobby Wilson"
RUN apt-get update
RUN apt-get install curl -y
RUN cd /usr/local; curl -O http://nodejs.org/dist/v0.10.16/node-v0.10.16-linux-x64.tar.gz
RUN cd /usr/local; tar xzf node-v0.10.16-linux-x64.tar.gz
ENV PATH /usr/local/bin:/usr/sbin:/bin:/usr/local/node-v0.10.16-linux-x64/bin
ADD . /app
EXPOSE 8000:8000
ENV PORT 8000
@ryansmith3136
ryansmith3136 / policy.json
Created September 20, 2013 23:10
AWS IAM Read Only
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:Describe*",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",
"cloudformation:GetTemplate",
require 'ostruct'
require 'minitest/autorun'
class P
attr_reader :x, :y
def initialize(x,y)
@x, @y = x, y
end
end
@ryansmith3136
ryansmith3136 / gist:7835702
Created December 7, 2013 00:40
Snake to camel
def s2c(x)
case x
when Hash then Hash[*x.flatten(1).map{|x| s2s(x)}]
when Array then x.map{|x| s2s(x)}
when Symbol then String(x).camelcase
else x
end
end
@ryansmith3136
ryansmith3136 / crafty.patch
Created December 20, 2013 16:46
Crafty: remove listener which prevents touchmove events
From 3bfcdec1cfbf155fade70afbb0a8aee91a46d5e3 Mon Sep 17 00:00:00 2001
From: Eric Rykwalder <e.rykwalder@gmail.com>
Date: Thu, 19 Dec 2013 18:38:23 -0800
Subject: [PATCH] fix disableTouch issue on crafty
---
static/libs/crafty.js | 9 ++++++---
static/systems/home.js | 2 ++
2 files changed, 8 insertions(+), 3 deletions(-)

Keybase proof

I hereby claim:

  • I am ryandotsmith on github.
  • I am ryandotsmith (https://keybase.io/ryandotsmith) on keybase.
  • I have a public key whose fingerprint is 2D60 72AC 8048 3B96 6F2E 5211 EC2F C28B D8ED AF6F

To claim this, I am signing this object:

@ryansmith3136
ryansmith3136 / index.js
Last active August 29, 2015 14:01
Chain - Send Transactions API
var chain = require('chain-node');
var bitcoin = require('bitcoinjs-lib');
// The Chain API will never accept your private key.
// Keep the private key stored in a safe place alongside
// your program.
var key = new bitcoin.ECKey.fromWIF("Your private key in WIF format.")
var txn = new bitcoin.Transaction()