Skip to content

Instantly share code, notes, and snippets.

View muncman's full-sized avatar

Kevin Munc muncman

View GitHub Profile
@johnbintz
johnbintz / gist:1809410
Created February 12, 2012 16:15
For the lazy, how to Guard::Guard your own Guard
# Guardfile
require 'guard/guard'
class ::Guard::JohnIsAwesome < ::Guard::Guard
def start
puts "Whoa a guard."
end
def run_all
" Use arrow keys to move buffers
map <up> <C-w>k<cr>
map <down> <C-w>j<cr>
map <left> <C-w>h<cr>
map <right> <C-w>l<cr>
@dlongmuir
dlongmuir / btserver_killer.rb
Created November 2, 2011 14:33
BTServer killer
#!/usr/bin/env ruby
# Kill crazy BTServer processes when the iPad simulator is running and
# you wake your Mac from sleeping
seconds_between_checking = 30
kill_threshold_percent = 10.0
while true do
ps_out_full = %x[ps aux | grep BTServer]
@frr149
frr149 / transparentModalViewController.m
Created October 20, 2011 18:58
How to create a transparent modal View Controller
#pragma mark - Transparent Modal View
-(void) presentTransparentModalViewController: (UIViewController *) aViewController
animated: (BOOL) isAnimated
withAlpha: (CGFloat) anAlpha{
self.transparentModalViewController = aViewController;
UIView *view = aViewController.view;
view.opaque = NO;
view.alpha = anAlpha;
@jonreid
jonreid / gist:1258076
Last active November 26, 2020 11:09
Terminal command to help you find preprocessor code smells in Objective-C code
find . \( \( -name "*.[chm]" -o -name "*.mm" \) -o -name "*.cpp" \) -print0 | xargs -0 egrep -n '^\w*\#' | egrep -v '(import|pragma|else|endif|HC_SHORTHAND|MOCKITO_SHORTHAND)'
@juanghurtado
juanghurtado / snipmatize.py
Created July 4, 2011 11:46 — forked from claytron/snipmatize.py
Convert TexMate snippets into snipMate compatible snippets
#!/usr/bin/env python2.6
"""
About
=====
Convert Texmate snippets into snipmate compatible snippets
http://www.vim.org/scripts/script.php?script_id=2540
http://macromates.com/
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@jeffkreeftmeijer
jeffkreeftmeijer / 1.png
Created April 18, 2011 12:39
Delta-E image diff
1.png
@searls
searls / sample.js
Created February 8, 2011 14:24
testing your jQuery binding in jasmine
(function($){
me = me || {};
$.extend(me,{
bind: function(){
$('body').delegate('a.modal','click',me.openModal)
},
openModal: function(){
var $link = $(this);
//...
}