Skip to content

Instantly share code, notes, and snippets.

@gecbla
gecbla / zend-route-chain.sublime-snippet
Last active December 19, 2015 03:39
Sublime Text 3 snippets for Zend Framework routes (supports static, regex, module & chain route)
<snippet>
<content><![CDATA[
; +------------------------------+
; | Chain route: ${1:routeName}
; +------------------------------+
resources.router.routes.${1}.type = Zend_Controller_Router_Route_Chain
resources.router.routes.${1}.chain = "${2}, ${3}$0"
]]></content>
<tabTrigger>zf-route-chain</tabTrigger>
@gecbla
gecbla / dog.js
Created July 16, 2013 12:31
JavaScript and OO Inheritance
// Child class
function Dog() {
// Call parent constructor
Pet.call(this);
// Override parents name-property
this.name = 'Ceasar';
}
@gecbla
gecbla / object-create.js
Last active December 19, 2015 19:48
Clone object in JavaScript - prototypal inheritance
/**
* @see http://javascript.crockford.com/prototypal.html
*/
if (typeof Object.create !== 'function') {
Object.create = function(o) {
var F = function() {};
F.prototype = o;
return new F();
};
}
@gecbla
gecbla / jQuery-iframe.js
Last active December 19, 2015 21:48
jQuery iframe snippet
// v1
var iframe = $('#iframe-id').context;
$('selector', $(iframe) ).
// v2
var $iframe = $('#iframe-id').contents();
$iframe.find('selector');
@gecbla
gecbla / uuid.js
Created July 23, 2013 17:20
Returns a random UUID in javascript
/**
* @see http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript#answer-13403498
* @see https://gist.github.com/jed/982883
*/
function b(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,b)};
var uuid = b();
@gecbla
gecbla / gist:6114197
Created July 30, 2013 15:52
Git - Clone branch
git clone -b devel https://github.com/dz0ny/LiveReload-sublimetext2.git LiveReload
@gecbla
gecbla / gist:7289378
Created November 3, 2013 11:48
jQuery otherwise
jQuery.fn.otherwise = function() {
/* @see https://groups.google.com/forum/#!topic/jquery-en/a-KhJ4IqEI0 */
return this.end().not(this);
};
---
layout: post
title: Part two on how I built my blog
category: Coding
tags: jekyll github rss
year: 2012
month: 3
day: 22
published: true
summary: A follow up post on how I built my blog
/*global window, define */
var FacebookConnect = {
options: {
appId: null, // {String} Your application ID
cookie: true, // {Boolean} Enables cookies to allow the server to access the session
logging: true, // {Boolean} Disable logging
session: null, // {Object} Use specified session object
status: true, // {Boolean} Fetch fresh status