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 cp = require('child_process'); | |
module.exports = function(dir, callback) { | |
// Note: don't use string to concat json, for commit subject may contain ' or " | |
var sep = "<_______GITLOG COMMITS START_________>"; | |
var pretty = sep + ["%s", "%an", "%ae", "%ai"].join('%n'); | |
var gitlog = cp.spawn('git', ['log', '--pretty=' + pretty, '--name-only'], {cwd: dir}); | |
var stdout = '', | |
stderr = ''; |
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 watch = require('node-watch'), | |
exec = require('child_process').exec; | |
watch('.', { recursive: true, followSymLinks: true }, function(filename) { | |
if(filename === "build.js") return; | |
console.log(filename, ' changed.'); | |
exec('./build.sh', function(error, stdout, stderr) { | |
if(stdout) console.log('stdout: ' + stdout); | |
if(stderr) console.log('stderr: ' + stderr); | |
if (error !== null) { |
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
// Sort by fitness | |
// JSON.stringify([[5, 3], [2, "string"], [4, 1]].sort()) | |
// "[[2,"string"],[4,1],[5,3]]" | |
// `a` and `b` are sorted by `a.toString()` - `b.toString()` | |
// See also: http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.11 | |
// 所以是不靠谱的: | |
// ["190", (2000000000000000000000000).toString(), (1000000000000000000000000000000000000).toString()].sort() | |
// ["190", "1e+36", "2e+24"] | |
this.population = this.population.map(function(individual) { |
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
gnome-shell -r --display=:0 |
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
ssh -A -t -p 23 server1 ssh -A server2 |
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
xprop -id $xid -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0" |
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(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
CSS3 Multiple Columns 拿来做瀑布流和响应式非常容易,除了栏必须是竖着的会影响排序这一点。 |
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
ip route add 10.76.8.61 via 192.168.1.1 dev br-wan |
NewerOlder