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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
@ECHO OFF | |
SETLOCAL | |
REM Speed up by checking for bin directory directly | |
IF NOT EXIST node_modules\.bin GOTO FINDBIN | |
SET BIN=.\node_modules\.bin | |
GOTO RUN | |
:FINDBIN | |
REM Find the current bin directory from npm, storing the result in 'BIN' |
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
/** | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { | |
return _.transform(object, function(result, value, key) { | |
if (!_.isEqual(value, base[key])) { |
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
/** | |
* Implementation of the Critical Path Method (CPM) with variation | |
* @see http://en.wikipedia.org/wiki/Critical_path_method | |
* | |
* Shows all the critical Paths, returns a subset of the graph | |
* containing the critical activities | |
*/ | |
/** | |
* Activity Class |
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
parseMustache = (str, obj) -> | |
str.replace /{{\s*([\w\.]+)\s*}}/g, (tag, match) -> | |
nodes = match.split(".") | |
current = obj | |
for node in nodes | |
try | |
current = current[node] | |
catch | |
return "" | |
current |
refer to: https://stackoverflow.com/questions/39371772/how-to-install-anaconda-on-raspberry-pi-3-model-b
{USER}: pi
Install Miniconda 3:
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh # (optional) check md5
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh # -> change default directory to /home/pi/miniconda3
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
const net = require('net'); // 引入網路 (Net) 模組 | |
const HOST = '10.10.10.168'; | |
const PORT = 9100; | |
let zpl = ` | |
^XA | |
^FO150,40^BY3 | |
^BCN,110,Y,N,N | |
^FD123456^FS | |
^XZ |