Skip to content

Instantly share code, notes, and snippets.

View jimeh's full-sized avatar

Jim Myhrberg jimeh

View GitHub Profile
@jimeh
jimeh / __readme.md
Created September 6, 2011 14:44
Let's not localize programming languages. Please >_<

Let's not localize programming languages. Please >_<

Feel free to fork and expand and/or add more languages as an example to why this would be horrible, and I'll add them here :)

@titanous
titanous / 0-readme.md
Created October 7, 2011 16:20
Ruby 1.9.3-p0 with ruby-debug19

Ruby 1.9.3-p0 with ruby-debug19

Ruby 1.9.3-p0 requires a minor patch to make ruby-debug19 work. If you have ruby-build and rbenv installed, these scripts will install ruby-1.9.3-p0.

curl https://raw.github.com/gist/1270704/install-ruby-1.9.3-p0.sh | sh
@lkraider
lkraider / adf2mp3.py
Created November 2, 2011 22:40
GTA Vice City ADF to MP3 audio converter
#!/usr/bin/env python
import sys
import os
def adf2mp3(input_path, output_path, buffer_size=1024*1024):
print 'Converting', output_path
input_file = open(input_path, 'rb')
output_file = open(output_path, 'wb')
for read_buffer in iter(lambda: input_file.read(buffer_size), ''):
@vmg
vmg / sparc.c
Created November 15, 2011 23:03
Sparks in C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
int main
(int argc
,char *ac []){int i, count = argc - 1;
double * dvalues=malloc(01- 01+count*
sizeof(double)+1); double mi=DBL_MAX,ran=.0,ma =DBL_MIN,mo;for(i= 00; argc>1
&&i<count;i=i+8-7) {double val = atof(ac[i+1]) ;if(23&&val<mi)mi= val;if(val
require 'formula'
class TmuxForIterm2 < Formula
url 'http://iterm2.googlecode.com/files/tmux-for-iTerm2-20120108.tar.gz'
md5 'f15d9f567b9b029482bb7b3227ee7ac3'
homepage 'http://code.google.com/p/iterm2/wiki/TmuxIntegration'
depends_on 'libevent'
def install
@jimeh
jimeh / Tango with Monokai.itermcolors
Created January 1, 2012 23:54
A iTerm color theme blending Tango Dark with Monokai.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@jimeh
jimeh / DefaultKeyBinding.dict
Created January 9, 2012 15:44
More Emacs-friendly keybindings in Cocoa Apps.
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Additional Emacs bindings */
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~<" = "moveToBeginningOfDocument:"; /* M-< */
"~>" = "moveToEndOfDocument:"; /* M-> */
"~v" = "pageUp:"; /* M-v */
"^v" = "pageDown:"; /* C-v */
@legumbre
legumbre / foo.md
Created June 29, 2012 00:14
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

@danparsons
danparsons / gist:3195652
Created July 29, 2012 01:46
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@ahamid
ahamid / spec_helper.rb
Created July 29, 2012 05:10
benchmark + profile RSpec test
require 'ruby-prof'
require 'benchmark'
module BenchmarkHelpers
PROFILE_OUTPUT_DIR = "profiling"
def self.safe_filename(name)
name.gsub(" ", "_")
end
def self.example_output_target_file!(example)