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 http = require('http'); | |
http.get('http://106.75.28.160/UCloud.txt', function(res) { | |
var body = ''; | |
res.on('data', function(d) { | |
body += d; | |
}); | |
res.on('end', function() { | |
var count = body.match(/UCanUup/g).length | |
console.log(count); | |
}); |
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
wget -q -O- http://106.75.28.160/UCloud.txt | grep -o 'UCanUup' | wc -l |
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
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
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 store() {} | |
function closure(obj) { | |
store.print = function() { | |
console.log(obj) | |
} | |
return function() { | |
store.print() | |
} | |
} |
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 proto = {}; | |
function express() { | |
var app = function(ctx, cb) { | |
app.handle(ctx, cb); | |
} | |
app.__proto__ = proto; | |
app.stack = []; | |
return app; | |
} |
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
/* | |
* demo reducer | |
* function demoReducer(state, action) { | |
* do something | |
* return state; | |
* } | |
* | |
* demo action | |
* { | |
* type: [type symbol] |
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
(defun find-subsequence-a (lst) | |
(let ((result '(1))) | |
(do ((l lst (cdr l))) | |
((null (cdr l)) result) | |
(let ((current (car l)) | |
(next (cadr l))) | |
(if (> next current) | |
(setq result (cons (1+ (car result)) result)) | |
(setq result (cons 1 result))))))) |
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
(defun compose (&rest funcs) | |
"compose functions, (compose f g) => (f (g args))" | |
;; at least one function is required | |
(if (null funcs) | |
nil | |
(destructuring-bind (fn . rest) (reverse funcs) | |
#'(lambda (&rest arguments) | |
(reduce #'(lambda (v f) | |
(funcall f v)) | |
rest |
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
path=$1 | |
ignoreFolder=$2 | |
walk() { | |
ss=${1#*${2}} | |
if [[ $ss == "" ]]; then | |
return | |
fi | |
if [[ -d $1 ]]; then | |
sub=`ls $1` |
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
#!/bin/bash | |
files=`find ./src -type f -regex "./.*.[^coffee]"` | |
for file in $files | |
do | |
path=`dirname $file` | |
newpath=`echo ${path//src/build}` | |
filename=`basename $file` | |
if [ ! -d $newpath ]; then |
OlderNewer