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
TBinaryProtocol.prototype.writeMessageBegin = function(name, type, seqid) { | |
if (this.strictWrite) { | |
this.writeI32(VERSION_1 | type); | |
this.writeString(name); | |
this.writeI32(seqid); | |
} else { | |
this.writeString(name); | |
this.writeByte(type); | |
this.writeI32(seqid); | |
} |
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 https = require('https'); | |
function main() { | |
var fired = 0, req; | |
req = https.request({ | |
host: 'localhost', | |
port: 8052, | |
path: '/', | |
method: 'GET' |
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
PING google.com (74.125.224.112): 56 data bytes | |
64 bytes from 74.125.224.112: icmp_seq=0 ttl=57 time=550.263 ms | |
64 bytes from 74.125.224.112: icmp_seq=1 ttl=57 time=910.745 ms | |
64 bytes from 74.125.224.112: icmp_seq=2 ttl=57 time=874.949 ms | |
64 bytes from 74.125.224.112: icmp_seq=3 ttl=57 time=667.673 ms | |
64 bytes from 74.125.224.112: icmp_seq=4 ttl=57 time=429.829 ms | |
64 bytes from 74.125.224.112: icmp_seq=5 ttl=57 time=569.470 ms | |
64 bytes from 74.125.224.112: icmp_seq=6 ttl=57 time=759.054 ms | |
Request timeout for icmp_seq 7 | |
64 bytes from 74.125.224.112: icmp_seq=7 ttl=57 time=1925.043 ms |
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/env python | |
# | |
# reset-onid.py - A script to allow you to keep your ONID password at Oregon | |
# State University. This script is (literally) untested and should not be used | |
# under any circumstances | |
# | |
# Dependencies: | |
# - httplib2 | |
# - The 'pwgen' utility | |
# |
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
// Thrift generated code | |
scribe_Log_result.prototype.write = function(output) { | |
output.writeStructBegin('scribe_Log_result'); | |
if (this.success) { | |
output.writeFieldBegin('success', Thrift.Type.I32, 0); | |
output.writeI32(this.success); | |
output.writeFieldEnd(); | |
} | |
output.writeFieldStop(); | |
output.writeStructEnd(); |
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
/** This is what a thrift service implementation in Node.js _currently_ looks like */ | |
var CURRENT_HANDLER = { | |
// On success, the return argument is passed as the only argument to the callback | |
HelloWorld: function(name, callback) { | |
callback("hello " + name); | |
}, | |
// When something goes wrong, there is no way to get the exception back to the client | |
UhOhWorld: function(name, callback) { | |
var e = new ttypes.UhOhException("I can't do that " + name); |
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
/** | |
* Note: this only currently supports the %s and %j formatters. | |
* | |
* The first call with any given formatter will be relatively slow, but every subsequent | |
* call with the same formatter should be very fast (in V8). | |
*/ | |
var cache = {}; | |
var SINGLE_QUOTE = new RegExp('\'', 'g'); |
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 foo(callback) { | |
fs.stat('foo', callback); | |
} | |
function bar(callback) { | |
foo(callback); | |
} |
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
// New style | |
/** | |
* @inheritdoc | |
*/ | |
SigningRequest.prototype.getSerializerDef = function() { | |
return { | |
'name': { | |
src: 'name', | |
type: 'string' | |
}, |
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
function returnReadyJob(res, job) { | |
function onReady() { | |
job.removeListener('ready', onReady); | |
job.removeListener('error', onError); | |
returnSwiz(res, job); | |
} | |
function onError(err) { | |
job.removeListener('ready', onReady); | |
job.removeListener('error', onError); |
NewerOlder