Skip to content

Instantly share code, notes, and snippets.

View Kevnz's full-sized avatar
💭
Writing the code

Kevin Isom Kevnz

💭
Writing the code
View GitHub Profile
@Kevnz
Kevnz / gist:3414161
Created August 21, 2012 10:11 — 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
@Kevnz
Kevnz / javascript_background_thread.js
Created September 19, 2012 04:56 — forked from jameswomack/javascript_background_thread.js
Extend function prototype to run a function as a WebWorker
Function.prototype.runOnBackgroundThread = function (aCallback) {
var _blob = new Blob(['onmessage = '+this.toString()],{"type":"text/javascript"});
var _worker = new Worker((webkitURL.createObjectURL || URL.createObjectURL)(_blob));
_worker.onmessage = aCallback;
_worker.postMessage();
}
var _test = function () {
postMessage((1+1).toString());
}
@Kevnz
Kevnz / launch_sublime_from_terminal.markdown
Created September 29, 2012 19:49 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@Kevnz
Kevnz / dabblet.css
Created April 7, 2013 10:59
My Mobile List
/**
* My Mobile List
*/
* { margin: 0; padding: 0; }
html { background: #eee; }
body { font: 14px Georgia, serif; }
ul { width: 250px; margin: 30px auto; }
ul { list-style: none; border: 3px solid #ccc; }
li { position: relative; padding: 10px; font: 12px "Lucida Grande", Arial, Sans-Serif; background: white; }
@Kevnz
Kevnz / dabblet.css
Created April 8, 2013 06:29
My Mobile List
/**
* My Mobile List
*/
* { margin: 0; padding: 0; }
html { background: #eee; }
body { font: 14px Georgia, serif; }
ul { width: 250px; margin: 30px auto; }
ul { list-style: none; border: 3px solid #ccc; }
li { position: relative; padding: 10px; font: 12px "Lucida Grande", Arial, Sans-Serif; background: white; }
@Kevnz
Kevnz / dabblet.css
Created April 8, 2013 06:29
My Mobile Navigation
/**
*
My Mobile Navigation
*/
* { margin: 0; padding: 0; }
html { background: #eee; }
body { font: 14px Georgia, serif; }
ul.list { width: 450px; margin: 30px auto; padding-top:50px; }
ul.list { list-style: none; border: 3px solid #ccc; }
ul.list li { position: relative; padding: 10px; font: 12px "Lucida Grande", Arial, Sans-Serif; background: white; }
YUI().use("singleton-class", function (Y) {
var instance1 = new Y.SingletonClass(),
instance2 = new Y.SingletonClass();
Y.log(instance1 === instance2); // true!
window.instance1 = instance1;
});
YUI().use("singleton-class", function (Y) {
/*global YUI*/
/**
* Prevents iOS from showing the URL bar for cancelled links
*
* @module ios-linkfix
* @requires base-build, event-touch, node-base, node-event-delegate, plugin
*/
YUI.add("ios-linkfix", function (Y, NAME) {
var HREF = "href",
DATA = "data-" + NAME,
YUI().use("singleton-class", function (Y) {
var instance1 = new Y.SingletonClass(),
instance2 = new Y.SingletonClass();
Y.log(instance1 === instance2); // true!
window.instance1 = instance1;
});
YUI().use("singleton-class", function (Y) {
@Kevnz
Kevnz / gist:6084599
Last active December 20, 2015 06:19
WDCNZ Speaker slides