Skip to content

Instantly share code, notes, and snippets.

View jimeh's full-sized avatar

Jim Myhrberg jimeh

View GitHub Profile
@jimeh
jimeh / jquery.myplugin.coffee
Created April 7, 2011 23:44
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
@jimeh
jimeh / en.rb
Created April 17, 2011 10:13
Locale template for fuzzyclock gem.
# encoding: utf-8
class FuzzyClock
@@locales ||= {}
@@locales[:en] = {
:about => "it's about %t",
:hour => {
0 => "twelve",
1 => "one",
2 => "two",
@jimeh
jimeh / show-and-hide-any-app.applescript
Created June 8, 2011 00:45
AppleScript to help make any app toggle-able via a global hotkeys like the Twitter and Sparrow apps.
-----------------------------------------
-- Show and Hide <application>
-----------------------------------------
--
-- This script allows you to easily
-- toggle the visibility of a specific
-- app, similar to how Twitter and
-- Sparrow toggle with their global
-- hotkey option.
--
@jimeh
jimeh / birds-of-paradise-theme.el
Created August 7, 2011 12:42
Slightly tweaked version of Paul M. Rodrigues' Emacs port of the Birds Of Paradise theme for Coda
;;; birds-of-paradise-theme.el --- custom theme for faces
;; Copyright (C) 2011 Paul M. Rodriguez <[email protected]>
;; This file is not part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@jimeh
jimeh / flymake-elisp.el
Created August 7, 2011 22:09
FlyMakeElisp
;;
;;; FlyMake Lisp
;;
;; from: http://www.emacswiki.org/emacs/FlymakeElisp
;;
(defun flymake-elisp-init ()
(unless (string-match "^ " (buffer-name))
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
@jimeh
jimeh / decode.rb
Created August 20, 2011 13:56
Ruby-based Benchmark of MessagePack vs. JSON & Yajl
# encoding: utf-8
require 'bench_press'
require 'json'
require 'yajl'
require 'msgpack'
extend BenchPress
reps 10_000
@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 :)

@jimeh
jimeh / emacs24-osx-srgb.diff
Created November 13, 2011 10:04
sRGB color patch for Emacs 24 on Mac OS X. More info: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8402
diff --git a/src/nsterm.m b/src/nsterm.m
index af1f21a..696dbdc 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1389,7 +1389,7 @@ ns_get_color (const char *name, NSColor **col)
if (r >= 0.0)
{
- *col = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: 1.0];
+ *col = [NSColor colorWithDeviceRed: r green: g blue: b alpha: 1.0];
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>