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'), | |
sys = require('sys'); | |
function walk(path, callback) { | |
var recur_or_cb = function( abspath ) { | |
return function(err, stats) { | |
if ( stats.isDirectory() ) | |
walk(abspath, callback); | |
else | |
callback(err, abspath); |
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
node> var hw = require("./helloworld"); | |
Error: /home/nate/test/build/default/helloworld.node: undefined symbol: _ZN10HelloWorld4s_ctE | |
at Module._loadObjectSync (node.js:360:13) | |
at Module.loadSync (node.js:336:12) | |
at loadModule (node.js:283:14) | |
at require (node.js:411:14) | |
at cwdRequire (repl:27:10) | |
at [object Context]:1:10 | |
at Interface.<anonymous> (repl:84:19) | |
at Interface.emit (events:26:26) |
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
/*$("div").prepend($('<div></div>').addClass("overlay"));*/ | |
div.overlay { | |
position:absolute; | |
background: #666666 url(../images/jquery-ui/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat; | |
opacity: .50; | |
filter:Alpha(Opacity=50); | |
width:300px; | |
height:200px; | |
} |
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
use strict; | |
use warnings; | |
use feature 'say'; | |
use JSON; | |
use Net::RabbitMQ; | |
use Data::Dumper; | |
my $queue = shift @ARGV || die "No queue specified"; |
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'); | |
var http = require('http'); | |
function sprintf(str,args) {if(args.length===0)return str;return sprintf(str.replace(/%s/,args[0]),args.splice(1));} | |
var page = 104; | |
var streams = {}; | |
var username = process.argv[2] || 'nate_smith'; | |
while (page > 0) { |
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 myfun = defun(function () { | |
// // do something with/to this.args; | |
// }); | |
defun = function defun() { | |
var orig_func = arguments[0]; | |
return function() { | |
// convert the arguments object into a plain old array | |
var args = Array.prototype.slice.call(arguments); | |
return orig_func.apply({args:args}); | |
} |
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
buffer = mmap.map(stats.size, mmap.PROT_READ, mmap.MAP_SHARED, fd, 0); | |
var lbl = new LineByLine(buffer); | |
var comment = ';'.charCodeAt(0); | |
var space = ' '.charCodeAt(0); | |
var xxx = '*'.charCodeAt(0); | |
var COMMENT = "comment"; | |
var DEF = "definition"; | |
var NULL = null; | |
var STATE = NULL; | |
var defbuff = ''; |
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
#!/usr/bin/perl | |
chdir 'posts'; | |
($f = `cat ../template.html`) =~ s/\$POSTS/`ls -r | xargs cat`/e; | |
`echo "$f" > ../build.html`; |
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
<!-- require jQuery, mustache, etc. --> | |
<script src="/marimo.js"></script> | |
<script> | |
// feed it a library object | |
marimo.init($); | |
marimo.add_widget({ | |
'id':'unique_str', | |
'murl':'http://some.api.com/public', | |
'widget_prototype':'request_widget' | |
}); |
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
medley_abuse_form.moderate = function() { | |
// AJAX for moderating a given object | |
this.emit('object_moderated'); | |
}; | |
medley_comments.render = function() { | |
// Render a template, put it on the page | |
this.on('object_moderated', function() { | |
this.refresh(); | |
}); | |
this.emit('comments_loaded'); |
OlderNewer