-
近期文章
近期迴響
Mr WordPress 在 Hello world! 文章存檔
- 2017 年 十月
- 2016 年 十二月
- 2016 年 十月
- 2016 年 九月
- 2016 年 七月
- 2016 年 六月
- 2016 年 五月
- 2016 年 三月
- 2016 年 二月
- 2016 年 一月
- 2015 年 八月
- 2015 年 六月
- 2015 年 四月
- 2014 年 十月
- 2014 年 八月
- 2014 年 七月
- 2014 年 六月
- 2014 年 五月
- 2014 年 四月
- 2014 年 一月
- 2013 年 十一月
- 2013 年 九月
- 2013 年 八月
- 2013 年 七月
- 2013 年 六月
- 2013 年 五月
- 2013 年 三月
- 2013 年 二月
- 2013 年 一月
- 2012 年 十一月
分類
其它
nodejs Get promise request
let browserStackConf = () => {
//curl -u “kuangmingchen1:Qm9ns9rQpFbAWzQxfxQx" https://www.browserstack.com/automate/browsers.json
var options = {
hostname: ‘www.browserstack.com’,
path: ‘/automate/browsers.json’,
method: ‘GET’,
auth: ‘kuangmingchen1:Qm9ns9rQpFbAWzQxfxQx’
};
return new Promise((resolve) =>{
var body= “;
const req = https.request(options, (res) => {
res.on(‘data’, (d) => {
body += d;
});
res.on(‘end’, () => {
console.log(‘…… no more response’, JSON.parse(body));
let a = [{
seleniumAddress: ‘http://hub-cloud.browserstack.com/wd/hub’,
‘browserstack.user’: ‘kuangmingchen1’,
‘browserstack.key’: ‘Qm9ns9rQpFbAWzQxfxQx’,
‘browserstack.debug’: true,
‘os’: ‘Windows’,
‘os_version’: ‘8.1’,
‘browserName’: ‘Chrome’,
‘browser_version’: ‘54.0’,
‘resolution’: ‘1280×1024’,
specs: [ ‘scenarios/_bundle.js’ ],
resultJsonOutputFile: null,
restartBrowserBetweenTests: false,
allScriptsTimeout: 90000,
jasmineNodeOpts: {
defaultTimeoutInterval: 2500000
}
}];
let b = JSON.parse(body);
let s = _.filter(b, (a) => { return a[‘browser’] == ‘chrome’;}).max(s, function(stooge){ return stooge.age; });
console.log(s)
resolve(a);
//resolve(JSON.parse(body));
});
});
req.end();
});
};
張貼在 Uncategorized
發表留言
Angular debugging
angular.element(document.querySelectorAll(‘i.icon-checkMark’))[0].$scope();
angular.element(document.querySelector(‘i.icon-checkMark’)).data().$classCounts;
張貼在 Uncategorized
發表留言
mac system
Homebrew directory:
~/Library/Caches/Homebrew/ctags-5.8_1.el_capitan.bottle.tar.gz
Ctags on mac:
# you have ctags but it does not work…
$ ctags -R –exclude=.git –exclude=log *
ctags: illegal option — R
usage: ctags [-BFadtuwvx] [-f tagsfile] file …
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew –prefix`/bin/ctags"
#try again! ctags -R –exclude=.git –exclude=log *
#puts tags file into you .gitignore (probably global) and you’re all set!
#PS. i was inspired to install ctags by https://workshops.thoughtbot.com/vim video by @r00k, thanks man!
Apache on Mac:
Mac OS X includes an Apache web server that can be controlled using apachectl
as root
. It’s usually started via launchd
, the corresponding configuration file is /System/Library/LaunchAgents/org.apache.httpd.plist
. If it’s not this Apache running on port 80, it is probably launchd, Apple’s implementation of a daemon manager.
http://superuser.com/questions/597398/no-idea-what-is-listening-on-port-80-in-os-x
Resize tmux screen:
Ctrl-B then option/alt-up/down
張貼在 Uncategorized
發表留言
what process is running on port
lsof -n -i4TCP:{PORT} | grep LISTEN
http://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x
張貼在 Uncategorized
發表留言
Add shortcuts in Mach
jump between words and start/end of lines in iTerm2 follow these steps:
- Go to iTerm2 Preferences (⌘,)
- Open the “Keys” tab
- Add the following Global Shortcut Keys
Jump to beginning of word
- Keyboard Combination: ⌥←
- Action: Send Escape Sequence
- Escape: b
Jump to end of word
- Keyboard Combination: ⌥→
- Action: Send Escape Sequence
- Escape: f
Jump to beginning of line
- Keyboard Combination: ⌘←
- Action: Send Hex Code
- Escape: 0x01
Jump to end of line
- Keyboard Combination: ⌘→
- Action: Send Hex Code
- Escape: 0x05
Don’t forget to remove the previous bindings:
- Open the “Profiles” tab
- Click the sub-tab ”Keys”
- Remove the mappings for key combinations ⌥← and ⌥→
張貼在 Uncategorized
發表留言