This file contains hidden or 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
$posts = Mango::factory('posts')->load(FALSE); | |
foreach($posts as $post) | |
{ | |
$content .= Kohana::debug($post->as_array()); | |
// clean up | |
$post->delete(); | |
} |
This file contains hidden or 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 redis = require('redis'), | |
client1 = redis.createClient(), client2 = redis.createClient(), | |
msg_count = 0, sys = require('sys'); | |
//List of jobs to do | |
var _jobs = []; | |
for (var i = 0; i < 1000; i++) { |
This file contains hidden or 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 eat() { | |
var q = _queue.pop(), l = _queue.length; | |
if (q === undefined) { | |
sys.debug("Nothing to eat :("); | |
} | |
else { | |
doWork(q); | |
} |
This file contains hidden or 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 args = process.argv.slice(2); | |
var exargs = { | |
'-a' : function(val) { | |
if(!val) return; | |
console.log('Arg a does stuff with ' + val); | |
}, | |
'-b' : function() { | |
console.log('arg b in da house'); |
This file contains hidden or 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
//Expected arguments w. actions | |
var exargs = { | |
//help | |
'-h' : function() { abort(usage); }, | |
//directory where modules reside | |
'-w' : function(val) { | |
if (!val) return; | |
worker.moduleDirs.push(val); | |
worker.reloadModules(); | |
}, |
This file contains hidden or 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
width: 96%;font-size:11px;display:block;clear:both;list-style:none;margin:10px 10px 10px 5px;padding:7px;background-color : #FFFFE6;color: #775100;border : 1px solid #FEE37A;font: 11px verdana,arial,sans-serif; |
This file contains hidden or 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 HashMap = function(cell_size) { | |
this.cell_size = cell_size; | |
this.grid = []; | |
} | |
HashMap.prototype._key = function(vec) { | |
var cellsize = this.cell_size; | |
return Math.floor(vec.x/cellsize) * cellsize + ' ' + | |
Math.floor(vec.y/cellsize) * cellsize; | |
} |
This file contains hidden or 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
//Buffering bison "packets" before websockets to remove overhead | |
var bison = require('./bison'); | |
var o1 = { name : "sven", nested : { boolzor : true } }; | |
var o2 = { name : "rolf" }; | |
var buf = []; | |
buf.push(o1); |
This file contains hidden or 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
/** | |
* Hairy Balls FSM | |
* | |
*/ | |
var FSM = function(s, is) { | |
this.states = s; | |
this.iState = is; | |
this.curState = is; | |
} |
This file contains hidden or 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 dependencies | |
*/ | |
var Vector = require('../public/lib/vector'), | |
_floor = Math.floor; | |
OlderNewer