This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* None of this works, just an idea. | |
* | |
* Idea is a REST based framework for backend of Backbonejs | |
* | |
* @twitter gsphpdev | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (PHP_VERSION >= 50400) { | |
function jsonEncode(){ | |
return call_user_func_array('json_encode', (array)func_get_args()); | |
} | |
}else{ | |
interface JsonSerializable{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint nomen: true */ | |
/*global console, define, Backbone, $, _ */ | |
define([ | |
'backbone' | |
], function () { | |
'use strict'; | |
var _session = null, _instantiated = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a local repo | |
git init | |
# create a remote repo | |
git --base init | |
# add a file to tracking | |
git add lemon.css | |
# add all files to tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shit for handling IPv6 & mysql storage, @gsphpdev | |
* Bloody headache... remember this Gavin! | |
*/ | |
/** | |
* Only PHP 5.4+ has this function so need to add one if not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
function processWatch(file, event) { | |
fs.stat(file, function(error, stat){ | |
if(error === null){ | |
switch(event){ | |
case 'rename': | |
// has it actually been changed or is it a node false positive (stupid node bug) | |
if(stat.ctime.toString() != stat.mtime.toString()){ | |
console.log(file + ' has actually been renamed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
function processWatch(file, event) { | |
fs.stat(file, function(error, stat){ | |
if(error === null){ | |
switch(event){ | |
case 'rename': | |
// has it actually been changed or is it a node false positive (stupid node bug) | |
if(stat.ctime.toString() != stat.mtime.toString()){ | |
console.log(file + ' has actually been renamed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'Slim/Slim.php'; | |
function app() | |
{ | |
static $app; | |
if(gettype($app) != 'object'){ | |
$app = new Slim(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window,document,undefined){ | |
var url,l; | |
el=document.getElementsByClassName('grabHolidayImages'); | |
if(el!=undefined){ | |
l=el.length; | |
for(i=0;i<l;++i){ | |
url = el[i].getAttribute('title'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window,document,undefined){ | |
var url,l; | |
el=document.getElementsByClassName('grabHolidayImages'); | |
if(el!=undefined){ | |
l=el.length; | |
for(i=0;i<l;++i){ | |
url = el[i].getAttribute('title'); |