Skip to content

Instantly share code, notes, and snippets.

View nickcheng's full-sized avatar
🛴
Transforming

nickcheng nickcheng

🛴
Transforming
View GitHub Profile
@nickcheng
nickcheng / snippet.py
Created July 9, 2018 14:14
#Python: How do I get key/value pairs from the BaseHTTPRequestHandler HTTP POST handler?
from sys import version as python_version
from cgi import parse_header, parse_multipart
if python_version.startswith('3'):
from urllib.parse import parse_qs
from http.server import BaseHTTPRequestHandler
else:
from urlparse import parse_qs
from BaseHTTPServer import BaseHTTPRequestHandler
name download_total
AFNetworking 61983241
Fabric 50998892
Crashlytics 49667729
SDWebImage 45471101
Alamofire 42097177
CocoaLumberjack 36071914
Bolts 35294870
FirebaseInstanceID 30277793
FirebaseAnalytics 30254593

Keybase proof

I hereby claim:

  • I am nickcheng on github.
  • I am yanan (https://keybase.io/yanan) on keybase.
  • I have a public key ASAaRskpSRDHrhi1WSs1QJPzmQAF9Ghed8FeAsEJM26cRQo

To claim this, I am signing this object:

@nickcheng
nickcheng / script.sh
Last active March 6, 2018 02:36
Replicate gems to newly upgrade ruby version via Rbenv.
rbenv shell 2.4.2
gem list | cut -d" " -f1 > my-gems
rbenv shell 2.5.0
gem in $(cat my-gems)
@nickcheng
nickcheng / script.sh
Created March 2, 2018 12:53
Install latest pipsi.
# Script comes from https://github.com/mitsuhiko/pipsi/issues/125#issuecomment-360321441
# Download the pipsi installer script from github
$ curl -O https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py
# Read about the --src option in the help menu
$ python get-pipsi.py --help
# Run the installer script to get the master branch from github
$ python get-pipsi.py --src=git+https://github.com/mitsuhiko/pipsi.git#egg=pipsi
@nickcheng
nickcheng / gitaliases.md
Created January 26, 2018 01:16
git aliases for ignoring files locally.
git config --global alias.ignore 'update-index --skip-worktree'
git config --global alias.unignore 'update-index --no-skip-worktree'
git config --global alias.ignored '!git ls-files -v | grep "^S"'

Ref: https://stackoverflow.com/posts/39086325/revisions

@nickcheng
nickcheng / evernotehtml_to_dayone.py
Created December 25, 2017 08:18
Modified version for Python 3.x
# -*- coding: utf-8 -*-
"""
Move notes from Evernote to DayOne2 on Mac
ILHO AHN (soleaf@gmail.com)
----
PROCEDURE
1 ) Open Evernote and select notes for export.
2 ) Right click and click 'Export Note...' to call 'Export Selected Notes' window.
3 ) Change Format to 'HTML' and save anywhere
4 ) To install DayOne2 CLI run 'sudo /Applications/Day\ One.app/Contents/Resources/install_cli.sh' on Terminal
@nickcheng
nickcheng / script.sh
Created November 29, 2017 05:42
Remove big file in GIT repo
# List the biggest object
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"
# Remove file from git repo
# Replace "filepath" to the file's full path
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch filepath' --prune-empty --tag-name-filter cat -- --all
# After doing so, remember to push it.
@nickcheng
nickcheng / config.json
Created November 24, 2017 09:35
VSCode configuration.
{
"editor.fontFamily": "Iosevka-Light",
"editor.fontSize": 14,
"[markdown]": {
"editor.lineHeight": 25
},
"files.associations": {
"*.podspec": "ruby"
},
// "editor.tokenColorCustomizations": {