使用open
命令,调用terminal
来打开abc
这个文件:
open -a /Applications/Utilities/Terminal.app "abc"
期中-a
这个参数保证打开一个新的terminal
实例
# 解决阿里云、腾讯云无法git clone | |
# 镜像到阿里源 | |
git config --global url."https://git.521000.best.cnpmjs.org/".insteadOf "https://github.com/" | |
git config --global protocol.http.allow always | |
# 备选 | |
git config --global url."https://hub.fastgit.org/".insteadOf "https://github.com/" | |
git config --global protocol.http.allow always |
#!/bin/bash | |
cd /tmp || exit | |
echo "Downloading sonar-scanner....." | |
if [ -d "/tmp/sonar-scanner-cli-4.0.0.1744-linux.zip" ];then | |
sudo rm /tmp/sonar-scanner-cli-4.0.0.1744-linux.zip | |
fi | |
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip | |
echo "Download completed." |
for i in ./*.js; | |
do mv "$i" "${i%.js}.ts"; | |
done |
### Keybase proof | |
I hereby claim: | |
* I am abnercrack on github. | |
* I am abnercrack (https://keybase.io/abnercrack) on keybase. | |
* I have a public key ASAytDTTleMxIxxC9fbBWJn8rX6MuAGrrhFjIU7Hvm34Dwo | |
To claim this, I am signing this object: |
/** | |
* This function takes a canvas, context, width and height. It scales both the | |
* canvas and the context in such a way that everything you draw will be as | |
* sharp as possible for the device. | |
* | |
* It doesn't return anything, it just modifies whatever canvas and context you | |
* pass in. | |
* | |
* Adapted from Paul Lewis's code here: | |
* http://www.html5rocks.com/en/tutorials/canvas/hidpi/ |
Node.js 镜像: http://npm.taobao.org/mirrors/node | |
alinode 镜像: http://npm.taobao.org/mirrors/alinode | |
phantomjs 镜像: http://npm.taobao.org/mirrors/phantomjs | |
ChromeDriver 镜像: http://npm.taobao.org/mirrors/chromedriver | |
OperaDriver 镜像: http://npm.taobao.org/mirrors/operadriver | |
Selenium 镜像: http://npm.taobao.org/mirrors/selenium | |
Node.js 文档镜像: http://npm.taobao.org/mirrors/node/latest/docs/api/index.html | |
NPM 镜像: https://npm.taobao.org/mirrors/npm/ | |
electron 镜像: https://npm.taobao.org/mirrors/electron/ | |
node-inspector 镜像: https://npm.taobao.org/mirrors/node-inspector/ |
handler.on('push', function (event) { | |
console.log('Received a push event for %s to %s', | |
event.payload.repository.name, | |
event.payload.ref) | |
run_cmd('sh', ['./update.sh'], function(text){ console.log(text) }) |
// getComponent is a function that returns a promise for a component | |
// It will not be called until the first mount | |
function asyncComponent(getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null; | |
state = { Component: AsyncComponent.Component }; | |
componentWillMount() { | |
if (!this.state.Component) { | |
getComponent().then(Component => { |
// PhantomJS Render to base64 function | |
page.renderBase64('png', function(err, img) { | |
var image = {}; | |
image.thumb = []; | |
final.full = new Buffer(img, 'base64'); // Convert the base64 encoded value into binary. | |
var thumbStream = new stream.Stream(); // Create a new writable stream | |
thumbStream.writable = true; | |
thumbStream.write = function (chunk) { | |
image.thumb.push(chunk); // Take the data written and store it into an array |