Skip to content

Instantly share code, notes, and snippets.

View hiroshi's full-sized avatar
🏠
Working from home

Hiroshi Saito hiroshi

🏠
Working from home
View GitHub Profile
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"SampleTable";
if (!tweetMessages) {
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.text = @"loading...";
cell.textLabel.textColor = [UIColor grayColor];
return cell;
}
@hiroshi
hiroshi / Makefile
Created December 1, 2011 04:59
Makefile for Testflight upload
# Testflight web interface doesn't allow input non-ASCII characters (e.g. Japanese) with Safari!
BROWSER = Google Chrome
TESTFLIGHT_TEAM_TOKEN_FILE = ./.testflight_team_token
TESTFLIGHT_TEAM_TOKEN_URL = https://testflightapp.com/dashboard/team/edit/?next=/api/doc/
TESTFLIGHT_TEAM_TOKEN = $(shell cat $(TESTFLIGHT_TEAM_TOKEN_FILE))
TESTFLIGHT_API_TOKEN_FILE = ~/.testflight_api_token
TESTFLIGHT_API_TOKEN_URL = https://testflightapp.com/account/\#api-token
TESTFLIGHT_API_TOKEN = $(shell cat $(TESTFLIGHT_API_TOKEN_FILE))
TESTFLIGHT_NOTES = 'This build was uploaded via the upload API'
#TESTFLIGHT_OTHER_OPTIONS = -F replace=True
@hiroshi
hiroshi / iOSMoviePlayButton.pjs
Created December 11, 2011 13:21
iOSMoviePlayButton.pjs
/* @pjs transparent=true; */
void setup() {
//int m = 5.2; // mergin
int s = 100; // size
size(s, s);
background(0, 0, 0, 0);
// background transparent circle
noStroke();
fill(0, 0, 0, 100);
ellipse(s/2, s/2, s, s);
@hiroshi
hiroshi / file0.txt
Created March 15, 2012 08:39
Xcode デバッガで [NSUserDefaults standardUserDefaults] みたいなクラスメソッドを使えないで困ったとき ref: http://qiita.com/items/3197
(lldb) po [NSUserDefaults standardUserDefaults]
error: Couldn't prepare the expression for execution in the target
(lldb) po [(Class)objc_getClass("NSUserDefaults") standardUserDefaults]
(id) $17 = 0x0644e5a0 <NSUserDefaults: 0x644e5a0>
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
Validate XML
Parse XML
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-6.xml
Validate XML: https://dl-ssl.google.com/android/repository/repository-6.xml
Parse XML: https://dl-ssl.google.com/android/repository/repository-6.xml
Found SDK Platform Android 1.1, API 2, revision 1 (Obsolete)
Found SDK Platform Android 1.5, API 3, revision 4
Found SDK Platform Android 1.6, API 4, revision 3
@hiroshi
hiroshi / file1.txt
Created April 27, 2012 02:50
Associative Object は自動で release, property は自分で release ref: http://qiita.com/items/c262c9b9f8e1044ac2e4
$ clang main.m -o main -framework Cocoa && ./main
-[Container dealloc]
-[Content dealloc] property
-[Content dealloc] associatedObject
@hiroshi
hiroshi / file0.sql
Created August 30, 2012 02:44
ActiveRecord :binary type のカラムを psql でテキストに変換して見る ref: http://qiita.com/items/1f5a92b3537624ae897e
SELECT encode(bin,'escape') FROM t;
@hiroshi
hiroshi / sh
Created September 21, 2012 00:37
.sha1 ファイルでなくハッシュ値だけあるときに verify する方法 ref: http://qiita.com/items/c2e9367dff315c86ce8a
$ echo "6393BA8BC2DD3CBD7B55D00B9D9587843BDB05CD Windows8-ReleasePreview-64bit-Japanese.iso" | shasum -c /dev/stdin
Windows8-ReleasePreview-64bit-Japanese-1.iso: OK
escape ^Tt
#bind ^q quit
startup_message off
bell 'bell in window[%]'
hardstatus alwayslastline "[%Lw]%=%H %d%M(%D)%c"
defscrollback 100000
defencoding UTF-8
defutf8 on
@hiroshi
hiroshi / Rakefile
Created April 11, 2013 07:32
heroku/ruby で bower install する hack ref: http://qiita.com/items/a8a01d6d69b99a9bb162
task "assets:precompile" do
`(cd /tmp && curl -O https://heroku-buildpack-nodejs.s3.amazonaws.com/nodejs-0.8.19.tgz)`
`(mkdir -p bin/nodejs && cd bin/nodejs && tar xzf /tmp/nodejs-0.8.19.tgz)`
`(cd bin && ln -s nodejs/bin/node node)`
`node bin/nodejs/bin/npm install`
end