Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@jamiew
jamiew / jdubs-screenrc
Created March 5, 2010 01:25
My screen config
vbell on
defscrollback 4096
escape ``
startup_message off
## default screens
screen -t bash 0 bash
screen -t bash 1 bash
screen -t bash 2 bash
screen -t bash 3 bash
@IskanderHaziev
IskanderHaziev / gist:774711
Created January 11, 2011 16:58
parsing cloudfront logs
require 'rubygems'
require 'zlib'
require 'aws/s3'
def parse_cloudfront_line(line)
return if line.strip.match(/^#/)
bytes = line.split("\t")[5]
filename = line.split("\t")[13]
info = {:file => filename, :bytes => bytes}
info if filename.strip != '-'
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@demonbane
demonbane / makeapp.sh
Created July 5, 2011 20:05
Create a Fluid-style app launcher for single-window Chrome instances on OSX
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@lcapaldo
lcapaldo / vhxenq.pl
Created September 19, 2011 00:14
Irssi script for automatically queueing video links to VHX.tv
use strict;
use Irssi;
use URI::Find::Rule;
use REST::Client;
use URI::Escape;
use vars qw($VERSION %IRSSI);
$VERSION = '0.01';
%IRSSI = (
@hotchpotch
hotchpotch / unicorn_killer.rb
Created October 3, 2011 08:11
Unicorn process killer utility
# # your config.ru
# require 'unicorn_killer'
# use UnicornKiller::MaxRequests, 1000
# use UnicornKiller::Oom, 400 * 1024
module UnicornKiller
module Kill
def quit
sec = (Time.now - @process_start).to_i
warn "#{self.class} send SIGQUIT (pid: #{Process.pid})\talive: #{sec} sec"
@hwatkins
hwatkins / ratings.rb
Created December 2, 2011 23:15
A script to use the Netflix paginated "What You've Rated" to pull what you have rated in Netflix. This call is not exposed in the Netflix API so it's hard to get any other way. This is quick and dirty so not the best Ruby constructs.
#!/usr/bin/env ruby
require 'iconv'
require 'nokogiri'
# This is a simple script to spider your Netflix paginated "What You've Rated" list.
# It requires an OS X based system with Ruby 1.9+, Safari, and AppleScript
#
# I could not find a way to back up my ratings (for all titles, not just my rental activity)
# without registering for a Netflix API key or handing my Netflix credentials over to someone
# who had an API key, so I decided to take a brute force approach and just parse the HTML for
@apeckham
apeckham / .gitignore
Created January 18, 2012 20:28
node duplicating proxy
node_modules
@kylemcdonald
kylemcdonald / scratchml.xml
Created January 22, 2012 23:19 — forked from jamiew/scratchml.xml
ScratchML draft spec v3
<sml>
<!--
# SCRATCH MARKUP LANGUAGE, WORKING DRAFT
http://scratchml.com
* version -- minor versions for small changes, major for incompatibilities
* info -- general file metadata: author info, client info etc.
* turntable - hardware metadata
* mixer -- hardware metadata