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
module.exports = function(grunt) { | |
'use strict'; | |
var path = require('path'); | |
var spawn = require('child_process').spawn; | |
grunt.registerTask('$', 'Run command in the form $::cmd:arg1:arg2, or $:/blah:cmd:arg.', function() { | |
var done = this.async(); | |
var args = Array.prototype.slice.call(arguments); | |
var cwd = process.cwd(); |
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
//I wanted a more elegant linkedlist example than the others, so purely for academic purposes I created one. | |
var LinkedList = function(e){ | |
var that = {}, first, last; | |
that.push = function(value){ | |
var node = new Node(value); | |
if(first == null){ | |
first = last = node; |
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 an new instance of a pixi stage | |
var stage = new PIXI.Stage(0x66FF99); | |
// create a renderer instance | |
var renderer = PIXI.autoDetectRenderer(400, 300); | |
// create a manager instance, passing stage and renderer.view | |
var manager = new PIXI.InteractionManager(stage, renderer.view); | |
stage | |
.on('click', function (event) { | |
console.log(event.type, event.target); // 'click', PIXI.DisplayObject {} |
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 an new instance of a pixi stage | |
var stage = new PIXI.Stage(0x66FF99); | |
// create a renderer instance | |
var renderer = PIXI.autoDetectRenderer(400, 300); | |
// Implements EventListener Interface (DOM Events Level 3) | |
renderer.view.addEventListener('mousedown', { | |
startTarget: null, | |
// Implement the EventListener Interface | |
handleEvent: function (event) { |
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 an new instance of a pixi stage | |
var stage = new PIXI.Stage(0x66FF99); | |
// create a renderer instance | |
var renderer = PIXI.autoDetectRenderer(400, 300); | |
// create a manager instance, passing stage and renderer.view | |
var manager = new PIXI.InteractionManager(stage, renderer.view); | |
stage | |
.on('click', function (event) { | |
console.log(event.type, event.target); // 'click', PIXI.DisplayObject {} |
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 | |
/** | |
* This is example output for the Tyrell example. | |
* It has been reformatted for readability. | |
*/ | |
return array ( | |
'Tyrell\\Everything' => array ( | |
'class' => '\\Tyrell\\Everything', | |
'namespace' => array ('Tyrell'), | |
'filename' => '/path/to/my-tonic-app/src/Tyrell/Everything.php', |
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
# Rebase any commits on top of anything new from remote | |
git pull --rebase $UPSTREAM_GIT_REMOTE $UPSTREAM_GIT_BRANCH | |
# get the tracking-branch name | |
tracking_branch=$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)) | |
# creates global variables $1 and $2 based on left vs. right tracking | |
# inspired by @adam_spiers | |
set -- $(git rev-list --left-right --count $tracking_branch...HEAD) | |
behind=$1 |
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
git checkout $GIT_BRANCH | |
git pull --rebase origin $GIT_BRANCH | |
lftp -e "open mybookmark; mirror -a --verbose=1 --parallel=10 --use-pget-n=3 --delete --only-newer --exclude .git --exclude .svn --exclude ^cgi-bin/$ --exclude ^wp-content/cache/$ $WORKSPACE; quit;" |
NewerOlder