Skip to content

Instantly share code, notes, and snippets.

@haranicle
haranicle / AppStoreScreenShotMaker.sh
Last active June 21, 2020 19:57
A shell script to create AppStore screen shots.
#!/bin/sh
# settings ==========
# src file name
fileNamePrefix="ScreenShotFileNameFor5.5inch"
offsetFor3_5=20
# dest directory name
@haranicle
haranicle / UniversalFrameworkMaker.sh
Last active October 27, 2015 01:29
A shell script to create an universal cocoa framework.
#!/bin/sh
FrameworkName="MyKitName"
rm -rf ./Debug
mkdir ./Debug
cp -r ./Debug-iphoneos/${FrameworkName}.framework ./Debug/${FrameworkName}.framework
lipo -create ./Debug-iphoneos/${FrameworkName}.framework/${FrameworkName} ./Debug-iphonesimulator/${FrameworkName}.framework/${FrameworkName} -output ./Debug/${FrameworkName}.framework/${FrameworkName}
@haranicle
haranicle / code-copyright-replace.sh
Created January 28, 2015 04:39
A shell script to remove "___FULLUSERNAME___" and "___COPYRIGHT___" from Xcode templates.
@haranicle
haranicle / Install bundler alias
Last active August 29, 2015 14:23
Install bundler alias
alias gemgen='rbenv local 2.1.2 && bundle init'
alias geminstall='bundle install --path=vendor/bundle --binstubs=vendor/bin'
PS1='\W🍣 \$'
@haranicle
haranicle / gist:4171703b6d0d2536fdb8
Created July 16, 2015 05:45
'RLMException', reason: 'Index is out of bounds.'
2015-07-16 14:44:42.806 AlcatrazTour[71604:2586803] *** Terminating app due to uncaught exception 'RLMException', reason: 'Index is out of bounds.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e81bc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110386bb7 objc_exception_throw + 45
2 Realm 0x000000010df7c5e7 -[RLMResults objectAtIndex:] + 343
3 Realm 0x000000010df7e5ae -[RLMResults objectAtIndexedSubscript:] + 62
4 AlcatrazTour 0x000000010dbc6c2c _TFC12AlcatrazTour25PluginTableViewController9tableViewfS0_FTCSo11UITableView21cellForRowAtIndexPathCSo11NSIndexPath_CSo15UITableViewCell + 140
5 AlcatrazTour 0x000000010dbc6f1f _TToFC12AlcatrazTour25PluginTableViewController9tableViewfS0_FTCSo11UITableView21cellForRowAtIndexPathCSo11NSIndexPath_CSo15UITableViewCell + 79
6 UIKit 0x000000010f1bb9e8 -[U
@haranicle
haranicle / CodePiece.swift
Created July 25, 2015 05:09
てすと #cswift #CodePiece
print("hello world")
@haranicle
haranicle / CodePiece.swift
Last active August 29, 2015 14:25
guardについて #cswift #CodePiece
guard let value != 0 else {
// ここでスコープを抜ける処理
return
break
continue
fatalError()
}
// 上の条件が満たされていることを前提としたコードが書ける
print( 100 / value )
@haranicle
haranicle / CodePiece.swift
Created July 25, 2015 05:40
deferについて #cswift #CodePiece
var handle:Handle = File.open(path)
// defer はスコープを抜ける直前に"必ず"実行される
defer {
print("close")
handle.close()
}
// 複数deferすることもできる
defer {
@haranicle
haranicle / CodePiece.swift
Created July 25, 2015 06:00
repeat-whileについて #cswift #CodePiece
repeat {
// ここを実行後にexpressionを評価
} while expression
// 例
var count = 100
repeat {
--count
} while count > 0