Skip to content

Instantly share code, notes, and snippets.

# extract_patches - Extracts patches from an .mbox
# USAGE:
# extract_patches [file]
#
# Will create "<revision>.log" containing the commit log, and "<revision>.patch" containing the actual diff.
# Assumes SVN-style commit log.
#
require 'rubygems'
require 'tmail'
# reformat_log - Reformats log messages
# USAGE:
# reformat_log [file]
#
# Will read the SVN-style commit log from file and generate commands in [file].sh
# which will recreate the commits in a git repository.
# Assumes the following:
# * You have a .patch file generated using extract_patches
# * Your git repository is in "trunk"
# * A copy of your repository in its final state in "all-files" (if you are adding binary files)
# Teambox API script which un-watches all conversations in a project.
#
# Usage: stop_watching_teambox.rb [project name] [last_id](optional)
#
# Feel free to use! - James
#
require 'rubygems'
require 'httparty'
module Teambox
<html>
<!--
EvilOnJavaRails
A quick and dirty microframework which works nothing like the actionview/actioncontroller code in rails.
Requires EJS (http://www.embeddedjs.com/) and jQuery.
Use at your own peril ;) - James
-->
@jamesu
jamesu / composeit.sh
Created November 20, 2010 13:31
composeit.sh
#!/bin/sh
# Composes animation frames in subdirectories into a single consolidated image
# e.g.
# composeit robot (Will combine robot{ANIMS}{DIRECTIONS}/*.png into a single robot.png)
THEBASE=$1
DIRECTIONS="NE NW SE SW"
ANIMS="Walk Idle"
DFILES=""
FRAME_SIZE="64x64"
@jamesu
jamesu / testing_fog.rb
Created January 29, 2011 12:57
How to use fog for Amazon ECS, irb edition
require 'fog'
connection = Fog::Compute.new( :provider => 'AWS', :aws_secret_access_key => '', :aws_access_key_id => '')
server = connection.servers.create(:image_id => "ami-76f0061f", :key_name => 'YourKey', :flavor_id => 't1.micro')
server.reload # see how we are doing
server.ready? # true when ready
@jamesu
jamesu / yt_download.js
Created January 31, 2011 16:16
Fixed that Youtube bookmarklet that puts download links for YT videos
// Convert to bookmarklet, run script. You should get download links for your video!
(function() {
if (document.getElementById('download-youtube-video')) return;
var args = null,
video_title = null,
video_id = null,
video_hash = null;
var download_code = new Array();
var fmt_labels = {
'18': 'standard MP4',
@jamesu
jamesu / Capfile.rb
Created June 23, 2011 21:47
Deploying chef with capistrano
# Deploying chef with capistrano
# Requires a typical chef config layout, i.e.
# cookbooks/
# nodes/
# roles/
#
# Commands:
# configure:<node> - Upload chef cookbooks, run chef-solo
#
# Roles will automatically be added from nodes/*.json. e.g. if you have
@jamesu
jamesu / hubscore.rb
Created July 4, 2011 13:32
Need to find the BEST project on github? This will help!
#!/usr/bin/env ruby
# hubscore
# Scores a project on github based on keyword metrics.
# Higher score = faster/in fashion. Lower score = slower/out of date.
#
# Usage:
# hubscore socketstream/socketstream
#
require 'rubygems'
require 'open-uri'