Skip to content

Instantly share code, notes, and snippets.

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

IKEDA Sho ikesyo

🏠
Working from home
View GitHub Profile
@lukeredpath
lukeredpath / AssertEventually.h
Created August 3, 2010 13:20
Enables simple and elegant testing of asynchronous/threaded code with OCUnit, blocks and OCHamcrest
//
// AssertEventually.h
// LRResty
//
// Created by Luke Redpath on 03/08/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "HCMatcher.h"
@mcmire
mcmire / current_controller_and_action.rb
Created December 31, 2010 08:54
Hacking Padrino to store current "controller" and "action"
# Put this in lib/current_controller_and_action.rb
module Padrino
module Rendering
module InstanceMethods
private
# Override render to store the current template being rendered so we can refer to it in the view
# This works with Padrino >= 0.9.10
def render(engine, data=nil, options={}, locals={}, &block)
# If engine is a hash then render data converted to json
@novi
novi / CocoaDesignPattern-Summary.md
Created February 15, 2011 17:54
Cocoaのデザインパターンまとめ
  • Singleton
  • Abstract Factory - |NSWindow| (Theme, Style)
  • Builder - WebKit Document Representation
  • Prototype - |NSCollectionViewItem|, Cell
  • FactoryMethod - |NSDocument|, ClassCluster
  • Adapter - Delegate, CocoaBinding
  • Bridge - |NSImageRep|, Wrapper
  • Composite - View Hierarchy, Tree
  • Decorator - |NSBox|, |NSScrollView|
  • Facade - |NSTextView|
@jonsterling
jonsterling / .gitignore
Created May 14, 2011 22:57
The Type Class Idiom in Haskell, Scala, C++, and Objective-C
*.class
*.swp
@osteslag
osteslag / version.sh
Created July 18, 2011 12:45
Script for managing build and version numbers using git and agvtool. See link in comments below.
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {
@incanus
incanus / Xcode4TestFlightintegration.sh
Created September 1, 2011 19:12
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
@cqa02303
cqa02303 / gist:1193858
Created September 5, 2011 01:28
dispatch_syncに絶望してこんな事をしている
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
dispatch_async(queue, ^{
// hogehoge
// ここに処理を書く
//
dispatch_semaphore_signal(semaphore);
});
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
dispatch_release(semaphore);
@novi
novi / gist:1486247
Created December 16, 2011 14:31
オレオレCocoaコーディングガイドライン
@novi
novi / gist:1486262
Created December 16, 2011 14:34
オレオレUIViewコーディングガイドライン

UIViewコーディングガイドライン

基本はコーディングガイドラインに沿う。

つまり、親クラス: コーディングガイドライン

クラス構造と階層モデル

  • 必要に応じてViewの内部で保有関係を階層化する
  • 一番親のView(Controllerと直接やりとりするView)でのControllerへのメッセージ送信にはデリゲートモデルを使う
@novi
novi / gist:1486278
Created December 16, 2011 14:37
オレオレUIViewControllerコーディングガイドライン