Skip to content

Instantly share code, notes, and snippets.

View aladdin-add's full-sized avatar
:octocat:
Focusing

唯然 aladdin-add

:octocat:
Focusing
  • China
  • 04:17 (UTC +08:00)
View GitHub Profile
@aladdin-add
aladdin-add / GPG and git on macOS.md
Created August 18, 2018 11:15 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@aladdin-add
aladdin-add / npm.taobao.sh
Created May 10, 2018 16:01 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set chromedriver_cdnurl http://cdn.npm.taobao.org/dist/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl http://cdn.npm.taobao.org/dist/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl http://cdn.npm.taobao.org/dist/phantomjs # phantomjs 二进制包镜像
npm set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass # node-sass 二进制包镜像
npm set electron_mirror http://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i' ]
2 info using npm@5.3.0
3 info using node@v8.2.1
4 verbose npm-session aca222e9b0b781ab
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall web-killer@0.0.1
7 info lifecycle web-killer@0.0.1~preinstall: web-killer@0.0.1
8 silly install loadCurrentTree
9 silly install readLocalPackageData
@aladdin-add
aladdin-add / pre-commit.sh
Created July 31, 2017 08:40 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
@aladdin-add
aladdin-add / Fix Cygwin Issue with RubyGem
Created June 4, 2017 19:10 — forked from devcfgc/Fix Cygwin Issue with RubyGem
No such file or directory — /cygdrive/c/Ruby/bin/gem (LoadError)
//We must add the following to your .bashrc (C:\cygwin\home\user\.bashrc):
alias ruby='/cygdrive/c/Ruby21-x64/bin/ruby'
alias gem='/cygdrive/c/Ruby21-x64/bin/gem.bat'
alias irb='/cygdrive/c/Ruby21-x64/bin/irb.bat'
alias compass='/cygdrive/c/Ruby21-x64/bin/compass.bat'
alias sass='/cygdrive/c/Ruby21-x64/bin/sass.bat'
alias scss='/cygdrive/c/Ruby21-x64/bin/scss.bat'