Skip to content

Instantly share code, notes, and snippets.

View halsk's full-sized avatar

Hal Seki halsk

View GitHub Profile
@halsk
halsk / file0.txt
Created March 16, 2013 13:31
NSInvocation を使ってクラスメソッドを呼ぶ ref: http://qiita.com/items/947b1cdaae17e29ce082
// define selector
SEL selector = @selector(postToURL:withParams:async:);
// get method signeture
NSMethodSignature* signature = [[self class] methodSignatureForSelector: selector];
// make NSInvocation instance
NSInvocation* invocation = [ NSInvocation invocationWithMethodSignature: signature ];
[invocation setSelector:selector];
[invocation setTarget:[self class]];
[invocation setArgument:&strurl atIndex:2];
[invocation setArgument:&params atIndex:3];
@halsk
halsk / file0.txt
Created March 14, 2013 15:30
Spending.jp クローンサイトの立ち上げ手順 (OpenSpending 対応版) ref: http://qiita.com/hal_sk/items/d1cfa971fbbc09777d20
% git clone git@github.com:{ACCOUNT_NAME}/{ACCOUNT_NAME}.github.io.git
Cloning into '{ACCOUNT_NAME}.github.com'...
remote: Counting objects: 895, done.
remote: Compressing objects: 100% (366/366), done.
remote: Total 895 (delta 500), reused 880 (delta 486)
Receiving objects: 100% (895/895), 1.02 MiB | 368 KiB/s, done.
Resolving deltas: 100% (500/500), done.
@halsk
halsk / file0.txt
Created March 12, 2013 13:51
Kiwi + AFNetworking で Undefined symbols for architecture エラーが出た場合の対処 ref: http://qiita.com/items/79499813fac37ad5cd8a
platform :ios, '5.1'
pod 'AFNetworking', '1.1.0'
target :NSRemoteJsonObjectTests, :exclusive => true do
pod 'Kiwi'
end
@halsk
halsk / NSURL+dictionaryFromQueryString.h
Created February 28, 2013 08:46
URLのパラメータ部分を NSDictionary に変換する ref: http://qiita.com/items/413ec7902f48ec39821f
#import <Foundation/Foundation.h>
@interface NSURL (dictionaryFromQueryString)
-(NSDictionary *) dictionaryFromQueryString;
@end
@halsk
halsk / file0.txt
Created February 25, 2013 16:14
Spending.jp クローンサイトの立ち上げ手順(古いです) ref: http://qiita.com/items/38c186efbd272ef59121
% git clone git@github.com:{ACCOUNT_NAME}/{ACCOUNT_NAME}.github.com.git
Cloning into '{ACCOUNT_NAME}.github.com'...
remote: Counting objects: 895, done.
remote: Compressing objects: 100% (366/366), done.
remote: Total 895 (delta 500), reused 880 (delta 486)
Receiving objects: 100% (895/895), 1.02 MiB | 368 KiB/s, done.
Resolving deltas: 100% (500/500), done.
@halsk
halsk / JSON
Created February 16, 2013 14:48
NSRails 的なクラスを自前で作ってみた ref: http://qiita.com/items/dc8d46a1da1e13efefe5
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 3
},
"objects": [
{
@halsk
halsk / MMPropertyUtil.h
Created February 16, 2013 14:13
Objective-C で、クラスのプロパティ一覧を取得する ref: http://qiita.com/items/ddeb79803bd097617bab
//
// MMPropertyUtil.h
// MoyaMap
//
// Created by Haruyuki Seki on 2/16/13.
// Copyright (c) 2013 Hacker's Cafe. All rights reserved.
//
#import <Foundation/Foundation.h>
@halsk
halsk / file0.txt
Created February 8, 2013 16:28
XCode での実機デバッグ時に、アプリが立ち上がらない場合の対応 ref: http://qiita.com/items/2f6dbe627cca99d334a2
"Couldn't register com.yourcompany.yourapp with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger."
@halsk
halsk / MapViewController.m
Created September 29, 2012 16:40
地図SDKは MapKit だけじゃない!OSMやBingが使える iOS用 Map SDK、route-me のセットアップ方法 ref: http://qiita.com/items/8f0d1e5b6d90bb93d883
id myTilesource = [[[RMCloudMadeMapSource alloc]
initWithAccessKey:@"YOUR_API_KEY" styleNumber:999] autorelease];
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {