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 readBytes(filename, position) { | |
fs.open(filename, 'r', function(err, fd) { | |
if (err) { | |
console.log(err.message); | |
return; | |
} | |
var readBuffer = new Buffer(5); |
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 | |
/** | |
* Sends statistics to the stats daemon over UDP | |
* | |
**/ | |
class StatsD { | |
/** |
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 | |
/* | |
* README | |
* mkdir one && mkdir two && mkdir three && touch one/blueprint-1.3.css && touch one/foobar.css && touch two/jquery.js && touch three/jquery-1.4.js | |
* | |
*/ | |
include('stack.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
var Step = require('./lib/step'); | |
Step( | |
function () { console.log("one"); }, | |
function () { console.log("two"); } | |
); |
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
browser | |
.chain | |
.session() | |
.and(function (browser) { // log out | |
try { | |
browser | |
.open('/') | |
.assertElementPresent('link=Log out') | |
.clickAndWait('link=Log out') | |
.assertElementPresent('link=Log in') |
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
browser | |
.chain | |
.session() | |
.and(function (browser) { | |
browser | |
.chain | |
.open('/') | |
.assertElementPresent('link=Log out') | |
.clickAndWait('link=Log out') | |
.assertElementPresent('link=Log in') |
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
sarcasm:~/src/tmp$ cat repl.js | |
repl = require("repl"); | |
repl.start("testrepl> "); | |
sarcasm:~/src/tmp$ node repl.js | |
testrepl> 5+5 | |
10 | |
testrepl> sarcasm:~/src/tmp$ echo "5+5" | node repl.js | |
node.js:63 | |
throw e; |
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 readline = require('readline'); | |
module.exports = readline; | |
readline.Interface.prototype.cursorToEnd = function() { | |
// place the cursor at the end of the current line | |
this.output.write( | |
'\x1b[0G\x1b[' + ( | |
this._promptLength + this.line.length | |
) + 'C' |
NewerOlder