Skip to content

Instantly share code, notes, and snippets.

@psiborg
psiborg / gist:1572150
Created January 6, 2012 20:00 — 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
citiesCallback({ "%C3%9Cr%C3%BCmqi" : { "city" : "%C3%9Cr%C3%BCmqi",
"lat" : 43.799999999999997,
"lon" : -86.417000000000002,
"wikipedia" : "%C3%9Cr%C3%BCmqi"
},
"%C4%B0zmir" : { "city" : "%C4%B0zmir",
"lat" : 38.433,
"lon" : -26.850000000000001,
"wikipedia" : "%C4%B0zmir"
},
@psiborg
psiborg / gist:1934457
Created February 28, 2012 19:14 — forked from leplatrem/gist:1415767
Leaflet Offline Tiles using SQL Storage
/*
* L.TileLayer.LocalCache : A tile layer using SQL Storage, if available.
*/
L.TileLayer.LocalCache = L.TileLayer.extend({
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
subdomains: 'abc',
@psiborg
psiborg / zepto-extras.js
Created March 2, 2012 14:42 — forked from pamelafox/zepto-extras.js
My Zepto Extras
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@psiborg
psiborg / index.html
Created April 19, 2012 20:29 — forked from jlord/index.html
Geocoder with Leaflet
<html>
<head>
<title>I'm learning</title>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://zeptojs.com/zepto.js" type="text/javascript"></script>
<script src="map.js" type="text/javascript"></script>
<style>
body {margin: 0; padding: 0; text-align: center;}
#button { -webkit-transition: -webkit-transform 3s ease-in; box-shadow: 0 0 25px #EFEF4D; margin: auto; margin-top: 15px; padding: 3px 6px; height: 20px; width: 200px;}
@psiborg
psiborg / gist:2920092
Created June 12, 2012 20:57
Page for displaying device orientation
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Orientation Test</title>
<style>
body { text-align: center; }
@media all and (orientation:portrait) {
body { font-size: 35em; margin-top: .3em; }
}
@psiborg
psiborg / penner_beziers.js
Created June 25, 2012 02:22 — forked from madrobby/penner_beziers.js
Penner beziers
var beziers = {
easeInQuad: '.55,.085,.68,.53',
easeInCubic: '.55,.055,.675,.19',
easeInQuart: '.895,.03,.685,.22',
easeInQuint: '.755,.05,.855,.06',
easeInSine: '.47,0,.745,.715',
easeInExpo: '.95,.05,.795,.035',
easeInCirc: '.6,.04,.98, .335',
easeInBack: '.6,-.28,.735,.045',
easeOutQuad: '.25,.46,.45,.94',
@psiborg
psiborg / window.console.js
Created August 7, 2012 03:32 — forked from bforrest/window.console.js
console log javascript snippet
if (!window.console) {
(function() {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i) {
window.console[names[i]] = function() {};
}
}());
}
function Queue() {
this.reset();
}
Queue.prototype.dequeue = function () {
if (this.empty() !== true) {
this.length -= 1;
return this.items.shift();
}
return undefined;