Skip to content

Instantly share code, notes, and snippets.

@j796160836
j796160836 / GitConfigEdit.sh
Last active August 29, 2015 14:20
Change default push applied on current branch
#!/bin/bash
cd ~/.git
git config --global push.default simple

First:

git rm -r --cached . 
git add .

Then:

git commit -am "Remove ignored files"

Reference:

@j796160836
j796160836 / DisableAndroidFileTransferAutostart.sh
Last active August 29, 2015 14:19
關閉 Android File Transfer 自動啟動
#!/bin/bash
# Ref: https://trjlive.com/2013/11/how-to-prevent-android-file-transfer-from-opening-each-time-a-device-is-connected/
AFT_PID=`ps aux | grep "Android\ File\ Transfer" | awk '{print $2}'`
for pid in $AFT_PID
do
kill -9 $pid
echo "Kill PID (${pid}) succeeded"
done
  • 顯示隱藏檔案:
    defaults write com.apple.finder AppleShowAllFiles TRUE;\killall Finder

  • 不顯示隱藏檔案:
    defaults write com.apple.finder AppleShowAllFiles FALSE;\killall Finder

@j796160836
j796160836 / [筆記] Git 使用教學.md
Last active April 21, 2017 12:26
Git 使用教學
@j796160836
j796160836 / KeyboardKeymap.md
Last active August 29, 2015 14:16
Keyboard keymap for presenter software

Keyboard Keymap

Windows

Windows PowerPoint

  • Shift + F5 (Current slide)
  • F5 (From beginning slide)
  • B (Black board)
  • W (White board)
  • Esc (Exit Slideshow)
@j796160836
j796160836 / GitTweak
Created January 28, 2015 02:24
Copy to your .bash_profile
### Git tweak
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "["${ref#refs/heads/}"] ";
}
function git_since_last_commit {
now=`date +%s`;
last_commit=$(git log --pretty=format:%at -1 2> /dev/null) || return;
@j796160836
j796160836 / ShowDebugKeyFingerprints.sh
Created January 5, 2015 08:30
Show android debug key's fingerprints. (MD5 / SHA1 / SHA256)
#!/bin/bash
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@j796160836
j796160836 / ConnectWearEmulator.sh
Created December 31, 2014 07:36
Use to connect android wear with android phone or genymotion
#!/bin/bash
DEVICE=`adb devices -l | sed '/List of devices/d' | sed '/clockwork/d' | head -n 1 | awk '{print $1}'`
adb -s $DEVICE -d forward tcp:5601 tcp:5601