Skip to content

Instantly share code, notes, and snippets.

View vansteki's full-sized avatar
🍵

vansteki vansteki

🍵
  • Taiwan
View GitHub Profile
@vansteki
vansteki / gist:975a61cdfb323a2856ae04986a7b01af
Created February 18, 2019 08:56 — forked from bradgorman/gist:4247000
JavaScript - iOS/Safari Photo Upload, Manipulation
<!DOCTYPE html>
<html>
<head>
<title>iOS6 Safari Photo Capture Demo</title>
<script type="text/javascript">
window.onload = function() {
var input = document.getElementById("input");
input.addEventListener("change", handleFile);
}
@vansteki
vansteki / cherry pick to multiple branches
Created January 21, 2019 04:05 — forked from klausbayrhammer/cherry pick to multiple branches
cherry-pick a commit to multiple branches
#!/bin/bash
function merge {
git pull --rebase
git cherry-pick -x $1
git status
echo "Commit? (y/n):"
read XN
@vansteki
vansteki / git-sync-all-branches.sh
Created August 2, 2018 04:12 — forked from piaoger/git-sync-all-branches.sh
git-sync-all-branches
# fetch all branches
# From: http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
git fetch --all
@vansteki
vansteki / tmux.md
Created December 18, 2017 02:42 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@vansteki
vansteki / README.md
Created May 22, 2017 14:13 — forked from githubutilities/README.md
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@vansteki
vansteki / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
netstat -nao | find "0.0.0.0:80"
@vansteki
vansteki / gist:3663082
Created September 7, 2012 04:14 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt