Skip to content

Instantly share code, notes, and snippets.

Ross Cousens scribblet

Block or report user

Report or block scribblet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scribblet
scribblet / taskRunner.js
Created Dec 27, 2013
Example task runner
View taskRunner.js
//makeThumbnail.js
module.exports = {
start : function(input, db){
// makeThumbnail
// save timestamp
db.save({...});
}
};
@scribblet
scribblet / closureDi.js
Created Dec 27, 2013
Closure form of DI
View closureDi.js
//makeThumbnail.js
module.exports = function(db) {
db = db || require('./database.js');
return {
start : function(input){
// makeThumbnail
// save timestamp
db.save({...});
}
View nodeJS
var Engine = require('engine');
var Car = function(name) {
this.name = name;
this.engine = new Engine(5);
}
Car.prototype.toString = function() {
return 'Car called ' + this.name + ' with engine power ' + this.engine.power + '.';
};
View modulePattern.js
function myThing(){
// data hiding
var collection = [];
var api = {};
api.methodOne = function(params){
collection.push(params.argument);
//...
};
api.methodTwo = function(params){
var something = api.methodOne(stuff);
View constructorPattern.js
function myThing(){
if(!(this instanceOf myThing)){
return new myThing();
}
var private = 'blah';
var api = this;
api.methodOne = function(params){
if(private){
//...
}
View awesome-php.md

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@scribblet
scribblet / .inputrc
Created Apr 18, 2013
Bash history hack
View .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
You can’t perform that action at this time.