Skip to content

Instantly share code, notes, and snippets.

@kevinkatzke
kevinkatzke / gist:3124541
Created July 16, 2012 19:32 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@kevinkatzke
kevinkatzke / gist:1989582
Created March 6, 2012 22:55
JavaScript: Sexy PubSub
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind.
// Hat tip Paul Irish
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
@kevinkatzke
kevinkatzke / gist:1989581
Created March 6, 2012 22:54
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@kevinkatzke
kevinkatzke / gist:1989580
Created March 6, 2012 22:54
JavaScript: jQuery Pubsub
(function($) {
var o = $( {} );
$.each({
on: 'subscribe',
trigger: 'publish',
off: 'unsubscribe'
}, function( key, api ) {
$[api] = function() {
o[key].apply( o, arguments );
@kevinkatzke
kevinkatzke / gist:1989578
Created March 6, 2012 22:54
HTML: Prompt Chrome Frame
<!-- Prompt IE6 users to install Chrome Frame -->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]-->