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 firmata = require( "firmata" ); | |
var board = new firmata.Board( "COM6", function() { | |
console.log( "Connected" ); | |
console.log( arguments ); | |
}); | |
board.sp.on('data', function(data) { | |
console.log( data ); | |
}); |
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
c:\src>node child-test.js | |
[STR] stdout "stdout" | |
[STR] stderr "stderr" | |
[END] code 123 | |
[END] stdout "stdout" | |
[END] stderr "stderr" | |
c:\src>node child-test.js | |
[STR] stdout "stdout" | |
[STR] stderr "stderr" |
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 flushExit( process, exitCode ) { | |
if ( process.stdout._pendingWriteReqs ) { | |
setTimeout(function() { | |
flushExit( process, exitCode ); | |
}, 1 ); | |
} | |
else { | |
process.exit( exitCode ); | |
} | |
} |
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
// Lots of indentation variety on this file trying | |
// to get JSHint to throw an indentation error | |
module.exports = function( grunt ) { | |
grunt.initConfig({ | |
jshint: { | |
all: [ | |
"Gruntfile.js" | |
], | |
options: { | |
indent: 1 |
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
// JSHint chokes when a UTF8 file is read that includes the BOM. | |
// This bug is fixed in grunt versions >= 0.4, but include the fix | |
// for previous versions as well since 0.4 is still in development / unstable. | |
// https://github.com/cowboy/grunt/issues/338 | |
// https://github.com/cowboy/grunt/commit/44b57274ceba147e24dcc121ed7d9b84e6ec4e49 | |
if ( parseFloat(grunt.version) < 0.4 ) { | |
var _readFile = grunt.file.read; | |
grunt.file.read = function() { | |
var src = _readFile.apply( this, arguments ); |
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
FB::VariantMap PluginTest::test() { | |
return FB::variant_map_of( "1", "1")( "2", "2" ); | |
} | |
error C2664: 'std::map<_Kty,_Ty>::map(const std::map<_Kty,_Ty> &)' : | |
cannot convert parameter 1 from 'FB::detail::VariantMapInserter<T>' to 'const std::map<_Kty,_Ty> &' |
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
// {"error":{"code":"missing-parameters","info":"One ore more required fields were not submitted."}} | |
$.ajax({ | |
url: "http://testserver/testswarm/api.php?action=addjob", | |
type: "POST", | |
dataType: "text", | |
data: { | |
authUsername: "dherman", | |
authToken: "12345", | |
jobName: "Test Run", |
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
paths: { | |
// Don't optimize jQuery since it'll be included as a part of our require-jquery script | |
jquery: "empty:" | |
}, | |
modules: [ | |
{ | |
name: "lib/require-jquery", | |
override: { | |
paths: { | |
jquery: "lib/jquery-1.7.2" |
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( $ ) { | |
var createXhr = $.ajaxSettings.xhr; | |
$.ajaxSettings.xhr = function() { | |
var xhr = createXhr(), | |
setRequestHeader = xhr.setRequestHeader; | |
xhr.setRequestHeader = function( name ) { | |
if ( name !== "X-Requested-With" ) { | |
return setRequestHeader.apply( xhr, arguments ); |
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() { | |
function polyfill( fnName ) { | |
if ( !Array.prototype[fnName] ) { | |
Array.prototype[fnName] = function( predicate /*, thisArg */ ) { | |
var i, len, test, thisArg = arguments[ 1 ]; | |
if ( typeof predicate !== "function" ) { | |
throw new TypeError(); | |
} | |
OlderNewer