Skip to content

Instantly share code, notes, and snippets.

@xhlwill
xhlwill / .gitconfig
Created July 7, 2017 11:03
[macOS] make git do the right thing
[core]
ignorecase = false
@xhlwill
xhlwill / git-assume-unchanged-a-folder.markdown
Last active February 16, 2023 07:43
git 忽略某个文件夹的修改状态

git update-index wants the file names on it's command line.

Step 1:

cd into the folder you want to assume is unchanged,

Step 2:

You can do either this:

@xhlwill
xhlwill / test-error.log
Created May 19, 2017 04:31
[Vue warn]: Cannot find element: #app
> @ test /Users/will/work/gitlab.-inc.com/new-live/pages/live
> npm run unit
> @ unit /Users/will/work/gitlab.-inc.com/new-live/pages/live
> ../../node_modules/.bin/cross-env BABEL_ENV=test ../../node_modules/.bin/karma start test/unit/karma.conf.js --single-run
19 05 2017 12:16:32.319:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
19 05 2017 12:16:32.323:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
19 05 2017 12:16:32.336:INFO [launcher]: Starting browser PhantomJS
@xhlwill
xhlwill / show-groups-users.sh
Last active July 3, 2017 13:54
show users and groups in macOS
# see all groups
dscl . list /groups
# see 'admin' group's members
dscacheutil -q group -a name admin
@xhlwill
xhlwill / .npmrc
Last active June 5, 2017 12:34
install node-sass and phantomjs using taobao mirror
sass_binary_site = https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl = https://npm.taobao.org/mirrors/phantomjs/
electron_mirror = https://npm.taobao.org/mirrors/electron/
registry = https://registry.npm.taobao.org
@xhlwill
xhlwill / gfwlist.txt
Created April 18, 2017 16:22
in case
W0F1dG9Qcm94eSAwLjIuOV0KISBDaGVja3N1bTogY3o2d2w4bVZyRGNYNkZUNW0w
TVdNdwohIEV4cGlyZXM6IDZoCiEgVGl0bGU6IEdGV0xpc3Q0TEwKISBHRldMaXN0
IHdpdGggRVZFUllUSElORyBpbmNsdWRlZAohIExhc3QgTW9kaWZpZWQ6IFRodSwg
MTMgQXByIDIwMTcgMjM6NDk6MzYgLTA0MDAKIQohIEhvbWVQYWdlOiBodHRwczov
L2dpdGh1Yi5jb20vZ2Z3bGlzdC9nZndsaXN0CiEgTGljZW5zZTogaHR0cHM6Ly9y
YXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2dmd2xpc3QvZ2Z3bGlzdC9tYXN0ZXIv
Q09QWUlORy50eHQKIQohIEdGV0xpc3QgaXMgdW5saWtlbHkgdG8gZnVsbHkgY29t
cHJpc2UgdGhlIHJlYWwKISBydWxlcyBiZWluZyBkZXBsb3llZCBpbnNpZGUgR0ZX
IHN5c3RlbS4gV2UgdHJ5CiEgb3VyIGJlc3QgdG8ga2VlcCB0aGUgbGlzdCB1cCB0
byBkYXRlLiBQbGVhc2UKISBjb250YWN0IHVzIHJlZ2FyZGluZyBVUkwgc3VibWlz
@xhlwill
xhlwill / user-rules.txt
Last active May 12, 2017 05:49
user rules for pac mode
! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheet
||gist.github.com^
||github.io^
||githubusercontent.com^
||s3.amazonaws.com^
||postmates.com^
||imgur.com^
||quora.com^
||quoracdn.net^
@xhlwill
xhlwill / show-all-files-in-finder.sh
Last active June 15, 2017 07:16
Display files with names that starts with a dot (.) in Finder
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
# then restart finder
@xhlwill
xhlwill / port.sh
Last active June 6, 2017 04:35
find processes that uses my tcp port
# You can try netstat
netstat -vanp tcp | grep 3000
# For OSX El Capitan and newer (or if your netstat doesn't support -p), use lsof
lsof -i tcp:3000
@xhlwill
xhlwill / .vimrc
Created March 26, 2017 08:37
vim configuration
execute pathogen#infect()
syntax enable
set background=dark
colorscheme solarized
filetype plugin on
filetype indent on
set nu