const ts = Date.now();
const sign = ts + sha256(Math.floor(1.01 * ts).toString()).toUpperCase().substring(0, 32);
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
BACKUP_DIR=~/Documents/settings/app-list/`hostname` | |
mkdir -p $BACKUP_DIR | |
cd $BACKUP_DIR | |
# backup brew | |
/usr/local/bin/brew bundle dump --force | |
# back node packages | |
source ~/.nvm/nvm.sh |
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
{"_id":"weibo-jiangnan","startUrl":["https://weibo.cn/u/2189910831"],"selectors":[{"id":"weibo","type":"SelectorElement","parentSelectors":["_root","next-page"],"selector":"div.c[id^=M]","multiple":true,"delay":0},{"id":"time","type":"SelectorText","parentSelectors":["weibo"],"selector":"span.ct","multiple":false,"regex":"([\\s\\S]+)(?=来自)(?=[\\s\\S]+)","delay":0},{"id":"msg","type":"SelectorText","parentSelectors":["weibo"],"selector":"_parent_","multiple":false,"regex":"","delay":0},{"id":"img","type":"SelectorImage","parentSelectors":["weibo"],"selector":"img.ib","multiple":false,"delay":0},{"id":"comment","type":"SelectorElementAttribute","parentSelectors":["weibo"],"selector":"a.cc","multiple":false,"extractAttribute":"href","delay":0},{"id":"next-page","type":"SelectorLink","parentSelectors":["_root","next-page"],"selector":"div.pa a:nth-of-type(1)","multiple":false,"delay":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
document.querySelectorAll('div.col-9 span.follow button') | |
.forEach((ele, i) => { | |
setTimeout(() => { | |
console.log(ele.click(), ele.title); | |
}, i * 100); | |
}); |
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
curl https://git.io/ -i -F "url=https://shawjia.github.io/vkxd/2018/11/05-fund" -F "code=start-fund" | |
# you get https://git.io/start-fund |
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
sips -s format gif doge.png --out doge.gif |
This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.
This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)
Make sure you have the latest version of XCode installed. Available from the Mac App Store.
Install the Xcode Command Line Tools:
xcode-select --install
- 编写 Objective-C 代码 简单扼要
Category extends class functionality without subclassing.
#import "ClassName.h"
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
### | |
load from CoffeeScript | |
just load, nothing else | |
### | |
{hello} = require './test' | |
hello() |
NewerOlder