Skip to content

Instantly share code, notes, and snippets.

View tokorom's full-sized avatar

tokorom tokorom

View GitHub Profile
if [ -e *.xcworkspace ]; then
find *.xcworkspace | head -1 | xargs open
elif [ -e *.xcodeproj ]; then
find *.xcodeproj | head -1 | xargs open
fi
@tokorom
tokorom / gist:11209159
Last active August 29, 2015 14:00
retrive ios keywords
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/Frameworks
find . -name "*.h" | xargs egrep -o '[-+]\s+\([^/]*;' | egrep -o '[-+]\s+.*' | sort | uniq > method_defines.txt
@tokorom
tokorom / gist:11341082
Created April 27, 2014 09:05
xcode from cui
#!/bin/sh
if [ $# -lt 1 ]; then
echo "USAGE: xcode_action [action]"
echo "action:"
echo " build"
echo " run"
echo " clean"
echo " open FileName:row"
exit 1
marketVersion=`xcrun agvtool what-marketing-version | grep "^Found " | head -1 | gsed -e "s/.*\"\([.0-9]\+\)\".*/\1/"`
if [ ${CONFIGURATION} = "Release" ]; then
versionString="\"$marketVersion\""
else
lastCommitDate=`xcrun git log -1 --format='%ci'`
versionString="\"$marketVersion ($lastCommitDate)\""
fi
xcrun agvtool new-version "$versionString"
if [ ${CONFIGURATION} = "Debug" ]; then
plistBuddy="/usr/libexec/PlistBuddy"
infoPlist=${TEMP_DIR}"/Preprocessed-Info.plist"
marketVersion=$($plistBuddy -c "Print CFBundleShortVersionString" $infoPlist)
versionPrefix="dev-"
lastCommitDate=`xcrun git log -1 --format='%ci'`
versionSuffix=" ($lastCommitDate)"
@tokorom
tokorom / gist:6a59a4461bb8187aacf2
Created July 23, 2014 10:24
Open current tmux pane logs in vim
tmux capture-pane -t 0 -S -32768; tmux show-buffer | vim - -c 32768
# autojump
function autojump-peco() {
local cd_history_path="~/.local/share/autojump/autojump.txt"
local SELECTED=$(eval more $cd_history_path | peco | cut -f2)
if [ 0 -ne ${#SELECTED} ]; then
eval echo "cd $SELECTED"
eval cd $SELECTED
fi
}
zle -N autojump-peco
@tokorom
tokorom / gist:eb63c9a5069202f13cfb
Created September 1, 2014 07:04
requestImageDataForAssetのdataから取れるmetadata
dict = {
ColorModel = RGB;
DPIHeight = 72;
DPIWidth = 72;
Depth = 8;
Orientation = 1;
PixelHeight = 2448;
PixelWidth = 3264;
"{Exif}" = {
ApertureValue = "2.275007124536905";
infix operator <<= {
associativity right
precedence 90
assignment
}
infix operator %= {
associativity right
precedence 90
assignment
@tokorom
tokorom / gist:c5eb5a33887d41fac804
Created September 15, 2014 18:21
[Swift] memo

http://www.muukii.me/blog/daily/815

こういう見えないクラスとの一致をSwiftでやる方法。

if "_UINavigationBarBackground" == NSStringFromClass(view.dynamicType) {

dynamicType & NSStringFromClass で文字列比較。。。