Skip to content

Instantly share code, notes, and snippets.

Yusuke Ito novi

Block or report user

Report or block novi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rsms / sleeping-barber.m
Created Nov 10, 2010
Sleeping barber with GCD (Grand Central Dispatch)
View sleeping-barber.m
int main (int argc, const char * argv[]) {
dispatch_queue_t waitingChairs = dispatch_queue_create("waitingChairs", 0);
dispatch_queue_t barber = dispatch_queue_create("barber", 0);
dispatch_semaphore_t semaphore = dispatch_semaphore_create(3);
NSInteger ident = 0;
while (++ident) {
if (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW) != 0) {
printf("Customer %d turned away\n", ident);
rsms / KVOChangeScope.hh
Created Nov 25, 2010
Conveniently mark Key-Value Observable properties as edited in Objective-C++
View KVOChangeScope.hh
* KVOChangeScope -- Conveniently mark edits for Key-Value Observations in
* Objective-C++ in custom setters.
* Example:
* - (void)setFoo:(id)value {
* kvo_scoped_change(foo);
* // your setter code here which might return at any moment
* }
boctor / BaseViewController.m
Created May 5, 2011
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
View BaseViewController.m
// BaseViewController.m
// Created by Peter Boctor on 5/4/11.
// Copyright (c) 2011 Peter Boctor
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
darkseed / Reachability.h
Created Aug 30, 2011 — forked from dhoerl/Reachability.h
Reachability (iOS) ARCified
View Reachability.h
File: Reachability.h
Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
Version: 2.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
poutyface / gist:1223553
Created Sep 17, 2011
QEMU: 仮想ボード ARM Cortex-A9 マルチコアで Linux を動かす
View gist:1223553
* QEMUの使い方を覚える
* Linuxをエミュレータ環境で動かしてみる
* ARM のクロス環境に慣れてみる
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active Mar 3, 2019
サバクラ両方で動く JavaScript の大規模開発を行うために
View scaling_isomorphic_javascript_code.ja.markdown

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

aki-null / gist:1497649
Created Dec 19, 2011
Core Text APIを使用した際に起こる行間の問題の回避
View gist:1497649
NSFont *normalFont = [NSFont systemFontOfSize:12];
CGRect renderFrame = CGRectMake(0, 0, 300, 50); // box to render the text into
static NSLayoutManager *layMan = nil;
if (!layMan) {
layMan = [NSLayoutManager new];
CGFloat lineHeight = [layMan defaultLineHeightForFont:normalFont]; // calculate the expected height of a line
NSDictionary *attrDict = [NSDictionary dictionaryWithObject:normalFont andKey:NSFontAttributeName];
geddski / nesting.js
Created Jan 14, 2012
helper function for nesting backbone collections.
View nesting.js
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] =;
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
Gab-km / smugnessProblem.rst
Created Apr 19, 2012
View smugnessProblem.rst


著者:Larry O'Brien



nakiwo / gist:3179598
Created Jul 26, 2012
Xcode4.4 iOS SDKで @yES,@no,array[...],dictionary[...]を使う
View gist:3179598
// Xcode4.4
// llvm4の機能のうち一部が、
// iOS 5.1 SDK で使えない
NSNumber *b = @YES; // error
NSArray *array = @[ @1, @2, @3 ];
NSNumber *n = array[1]; // error
You can’t perform that action at this time.