Skip to content

Instantly share code, notes, and snippets.

View jiro's full-sized avatar

Jiro Nagashima jiro

View GitHub Profile
@pokeb
pokeb / gist:150447
Created July 20, 2009 17:03
An example showing how to manage a queue with ASIHTTPRequest
//
// MyController.h
//
// Created by Ben Copsey on 20/07/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GHUnit/GHUnit.h>
@class ASINetworkQueue;
@danielphillips
danielphillips / DJPWebView.h
Created April 28, 2011 14:06
UILabel rich text solution using UIWebView
#import "DJPWebViewDelegate.h"
#import "DJPWebViewContent.h"
@interface DJPWebView : UIWebView {
DJPWebViewDelegate* delegateObject;
DJPWebViewContent* content;
}
@property(nonatomic, retain)DJPWebViewContent* content;
@tricknotes
tricknotes / config.ru
Created November 12, 2011 05:59
config.ru for gollum
require 'rubygems'
require 'bundler/setup'
require 'gollum/frontend/app'
Precious::App.set(:gollum_path, File.dirname(__FILE__))
Precious::App.set(:wiki_options, {})
run Precious::App
@novi
novi / gist:1486247
Created December 16, 2011 14:31
オレオレCocoaコーディングガイドライン
@laiso
laiso / README
Created January 16, 2012 05:12
jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定
launchctl load -wF -D user ~/Library/LaunchAgents/jenkins.plist
launchctl list | grep jenkins
# 58066 - jenkins
launchctl start jenkins
open http://localhost:8080/
@setoh2000
setoh2000 / gist:1953420
Created March 1, 2012 21:39
UITableViewでスクロール停止時に表示されるセルを予想する iOS5以降
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
UITableView *tableView = (UITableView *)scrollView;
int n = tableView.frame.size.height / _cellHeight;
if ((int)tableView.frame.size.height % (int)_cellHeight) n++;
for (int i = 0; i <= n; i++) {
NSIndexPath *indexPath = [tableView indexPathForRowAtPoint:CGPointMake(0, targetContentOffset->y + i * _cellHeight)];
@kishikawakatsumi
kishikawakatsumi / gist:2757488
Created May 20, 2012 09:32
merge managed context in CoreData
// バックグラウンドでGoogle Calendarからイベントを受信して保存するクラス
- (void)main {
if (!self.isCancelled) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (!self.isCancelled) {
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];
[managedObjectContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy];
SPEventStore *eventStore = [SPEventStore defaultEventStore];
events = [[eventStore searchEventsWithPredicate:predicate] retain];
}
@kaz29
kaz29 / MyTestSegue.m
Created June 4, 2012 04:47
StoryBoard sample
//
// MyTestSegue.m
// StoryBoardTest
//
#import "MyTestSegue.h"
@implementation MyTestSegue
- (void)perform
@tomohisa
tomohisa / gist:2897676
Created June 8, 2012 19:20
Add and Remove ChildViewController
// add child view
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"];
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 44, 320, 320);
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
// remove child view
UIViewController *vc = [self.childViewControllers lastObject];
[vc.view removeFromSuperview];
@danielres
danielres / README.markdown
Created July 22, 2012 00:19
Using Font Awesome with Octopress
  1. Download Font Awesome (source)
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octpress/source/fonts' and put there the 4 font files (ttf, svg, eot and woff).
  5. In your stylesheet:
  • $fontAwesomePath: "fontawesome-webfont"
  • @import font-awesome

Done !