Skip to content

Instantly share code, notes, and snippets.

View micap's full-sized avatar

Mica Huynh micap

  • Melbourne
View GitHub Profile
@micap
micap / Count characters in a word
Created May 18, 2016 00:49
Count characters in a word
echo -n "XN--VERMGENSBERATUNG-PWB" | wc -c
@micap
micap / .lldbinit
Last active August 29, 2015 14:17
# recursive description of the views hierarchy curtesy of Rob Mayoff
# usage: (lldb) rd -- UIWindow keyWindow
# (lldb) rd self.view -- self.view
# (lldb) rd 0x8a2e3f0 -- view at that address
command regex rd 's/^[[:space:]]*$/po [[UIApp keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/'
# auto layout trace - shows ambiguous layout
# usage: (lldb) alt -- UIWindow keyWindow
# (lldb) alt self.view -- self.view
@micap
micap / watchkit_developer_resources.md
Last active August 29, 2015 14:17
WatchKit Developer Resources

A WatchKit app requires an existing iOS app. The WatchKit app is implemented as a separate target of your Xcode project and is built and packaged inside your iOS app’s bundle.

Apple

function _reset_all_sim {
# Reset all apps and data on from all iOS Simulators
# Attention: Simulator can only be reset if it is not opend
instruments -s devices \
| grep Simulator \
| grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" \
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
@micap
micap / .bash_profile
Last active December 22, 2015 15:09
bash_profile- my setup
# aliases
# aliases - general
alias sb="source /Users/<user>/.bash_profile"
alias mb="mate /Users/<user>/.bash_profile"
# aliases - git
alias g="echo git status; git s"
alias gu="echo git push; git push"
alias gd="echo git pull; git pull"