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
sas2flash.efi -l log.txt -debug -o -f 2118IT.BIN -b MPTSAS2.ROM | |
Advanced Mode Set | |
Adapter Selected is a LSI SAS: SAS2008(B2) | |
Chip status 0000000000000000: | |
Executing Operation: Flash Firmware Image |
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
module.exports = function () { | |
console.log(this === global); | |
} |
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 addNumber=function(x){ | |
//first class function : a function treated as an object | |
return function(y){ | |
//x is a free variable. (i.e. not a local variable or an argument of this function.) | |
//x is bound to the argument x in lexical environment defined by the addNumber function | |
return x+y; | |
}; | |
}; |
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
SerialPort = require('serialport').SerialPort |
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
//create object with function | |
var Foo=function(){ | |
}; | |
//set the bar method on the prototype | |
Foo.prototype={ | |
bar:function(){ | |
console.log("bar"); | |
} | |
}; | |
var foo=new Foo(); |
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 Button(text){ | |
this.text = text; | |
} | |
Button.prototype.onClick=function(callback){ | |
//set fake x,y coordinates | |
var x=0,y=0; | |
callback.apply(this,[x,y]); | |
}; | |
var button = new Button('The Button'); | |
button.onClick(function(x,y){ |
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 letX(){ | |
var x = 0; | |
if(true){ | |
let x = 1; | |
//1 | |
console.log(x); | |
} | |
//0 | |
console.log(x); | |
} |
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
// On Arduino Uno 2.2 | |
// Using Examples > Firmata > StandardFirmata_2_2_forUNO_0_3 | |
var firmata = require("./firmata/lib/firmata"); | |
var board = new firmata.Board("/dev/tty.usbmodem621",function(){ | |
//code for board needs to go here | |
console.log(board); // logs board object, board.pins is empty | |
board.digitalWrite(2, 1); // generates error can't write value to undefined | |
}); |
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 deferredTask = function(){ | |
var dfd = $.Deferred(); | |
someAsyncCall(function(data){ | |
dfd.resolve(data); | |
}); | |
return dfd.promise(); | |
}; | |
var deferredTasks = []; | |
for(var i = 0; i < 3; i++){ | |
deferredTasks.push(deferredTask()); |
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
// data structure for node | |
var Node = function(char,isLastChar){ | |
this.char = char; | |
this.isLastChar = isLastChar; | |
this.children = {}; | |
}; | |
//adds a word to a node/tree | |
var addWord = function(tree,word){ | |
var chars = word.split(''); | |
//when adding a node to a tree, the currentNode starts as the tree |
OlderNewer