Skip to content

Instantly share code, notes, and snippets.

novi / CoreFoundationOwnClassTest.c
Created Oct 28, 2010
Create your own CFType Class
View CoreFoundationOwnClassTest.c
// Created by Yusuke Ito, @novi_
#include <CoreFoundation/CoreFoundation.h>
#define UseCFHeader 0
#if UseCFHeader
#include "CFRuntime.h"
novi / gist:789414
Created Jan 21, 2011
View gist:789414
novi / _CFHash: armv6 disassemble
Created Jan 25, 2011
_CFHash: armv6 disassemble
View _CFHash: armv6 disassemble
000074fc b5b0 push {r4, r5, r7, lr}
000074fe af02 add r7, sp, #8
00007500 1e04 subs r4, r0, #0
00007502 d034 beq.n 0x756e
00007504 6821 ldr r1, [r4, #0]
00007506 2900 cmp r1, #0
00007508 d01d beq.n 0x7546
0000750a 4b20 ldr r3, [pc, #128] (0x758c)
0000750c 447b add r3, pc
novi /
Created Feb 15, 2011
  • 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|
novi / gist:939582
Created Apr 24, 2011
-[UIBezierPath stroke] arm
View gist:939582
-[UIBezierPath stroke]:
000f1470 e92d40b0 push {r4, r5, r7, lr}
000f1474 e28d7008 add r7, sp, #8 @ 0x8
000f1478 e1a05000 mov r5, r0
000f147c ebfcb22d bl _UIGraphicsGetCurrentContext
000f1480 e1a04000 mov r4, r0
000f1484 eb0bce73 bl 0x3e4e58 @ symbol stub for: _CGContextSaveGState
000f1488 e59f30c8 ldr r3, [pc, #200] @ 0xf1558
000f148c e1a00004 mov r0, r4
000f1490 e79f1003 ldr r1, [pc, r3]
novi / gist:939592
Created Apr 24, 2011
otool -o option
View gist:939592
UIKit (architecture armv6):
Contents of (__DATA,__objc_classlist) section
0048edf4 0x4f5cb0
isa 0x4f5c9c
superclass 0x4f6020
cache 0x0
vtable 0x0
data 0x490274 (struct class_ro_t *)
flags 0x0
instanceStart 44
novi / sample.pdf
Created Apr 27, 2011
日本語のサンプルPDF(手打ち) 一部Requiredオブジェクト無し
View sample.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
novi / header.h
Created May 24, 2011
View header.h
typedef void* StringRef;
StringRef StringCreateWithCString(const char* cstr); // Stringを作成
StringRef StringCreateFromFile(const char* path); // ファイルから作成
int StringGetLength(StringRef str); // 文字列の長さを取得
float StringGetFloat(StringRef str); // 文字列から数値に変換
int StringGetInt(StringRef str);
novi / test.m
Created May 28, 2011
View test.m
CGRect r = CGRectMake(1.222, 1.3333, 1, 1.000);
NSLog(@"%@", NSStringFromCGRect(r));
NSLog(@"%@", NSStringFromCGRect(CGRectIntegral(r)));
NSLog(@"%@", NSStringFromCGRect(CGRectMake(floorf(r.origin.x), floorf(r.origin.y), floorf(r.size.width), floorf(r.size.height))));
NSLog(@"%@", NSStringFromCGRect(CGRectMake(ceilf(r.origin.x), ceilf(r.origin.y), ceilf(r.size.width), ceilf(r.size.height))));
STAssertTrue(CGRectEqualToRect(r, CGRectIntegral(r)), nil, nil);
novi / pdfwalker.on.Mac.txt
Created Jun 17, 2011
PDFWalkerインストール on Mac OS X 10.6.7
View pdfwalker.on.Mac.txt
* brew install libtiff
* brew install gtk+
** gtk+のインストールに失敗するときは、
** /usr/local/lib/libintl.dylibが無いときは、
* gem install origami gtk2
* mkdir -p ~/.local/share
** pdfwalkerが起動しないとkは、 /Library/Ruby/Gems/1.8/gems/origami-1.0.3/bin/pdfwalker:3 RUBY_VERSION を1.8以上にする
You can’t perform that action at this time.