Skip to content

Instantly share code, notes, and snippets.

var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5]
func partition(v: Int[], left: Int, right: Int) -> Int {
var i = left
for j in (left + 1)..(right + 1) {
if v[j] < v[left] {
i += 1
(v[i], v[j]) = (v[j], v[i])
}
}
@Kuniwak
Kuniwak / 2013_11_15_githubjp_note.markdown
Last active October 30, 2018 07:06
「GitHub トレーニングチームから学ぶ Git の内部構造」のノートです。 曖昧なところもあるので、間違いがあったら教えてください! http://connpass.com/event/3808/

GitHub トレーニングチームから学ぶ Git の内部構造

Graphs, Hashes, and Compression, Oh My!

Hash について

従来の CVCS (集中バージョン管理システム)のリビジョン番号は連番。 SVN はサーバーにデプロイした時点でリビジョン番号1と設定される。

@goldsmith
goldsmith / numpy_os_x_10_9.sh
Last active January 6, 2024 07:25
How to install Numpy and Scipy on Mac OS X Mavericks (10.9) using Pip.
# set up flags for Numpy C extentions compiling
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export CC=gcc-4.2
export CXX="g++ -arch i386 -arch x86_64"
pip install numpy
# success!
@ryugoo
ryugoo / iOS7Yahoo.md
Created October 7, 2013 12:40
iOS 7 エンジニア勉強会 @yahoo - 2013/10/07
  • Yahoo! 株式会社
  • 2013/10/07
  • 資料は後ほどシェア

iOS 7 でアプリ開発はどう変わる (佐野さん)

  • iOS 7 のデザイン原則
    • UI はコンテンツに従順 * Safari が分かりやすい
  • ナビゲーションバーが殆ど消える
@japboy
japboy / oculus-rift-notes.md
Last active August 14, 2017 18:44
Oculus Rift について。

Oculus Rift メモ

概要

2012 年 8 月に Kickstarter 上で立ち上げられたプロジェクト。新しいゲーム用バーチャルリアリティ (VR) ヘッドセットとして高い注目を集め、同年 9 月に 250,000 USD 資金調達目標を大きく上回る 2,437,429 USD の資金調達に成功し、プロジェクトのスタートを切る。

同種のデバイスとしては Sony のヘッドマウントディスプレイ (HMD) である HMZ シリーズなどが考えられるだろうが、Oculus Rift はこれをはるかにしのぐ機能と性能を兼ね備えている。

@indragiek
indragiek / gist:5200264
Created March 19, 2013 21:23
Easy Core Data fetching/inserting
- (void)fetchWithRequest:(NSFetchRequest *)request
completion:(void(^)(NSArray *results, NSError *error))handler
{
[request setResultType:NSManagedObjectIDResultType];
void (^executeHandler)(NSArray *, NSError *) = ^(NSArray *results, NSError *error){
dispatch_async(dispatch_get_main_queue(), ^{
if (handler) handler(results, error);
});
};
[self.backgroundContext performBlock:^{

詳細はWiki

https://github.com/allending/Kiwi/wiki

はまったところ

  • 全てオブジェクトである必要がある。
  • intなどはtheValue()でラップする必要がある。
  • should receiveはテストするメソッド実行前に書いておく必要がある。
  • should equalなどの実行結果の確認はテストするメソッド実行後に書いておく必要がある。
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@keijiro
keijiro / unity-animated-gif.md
Created August 12, 2012 08:48
Unity の画面を Animated GIF に変換して Tumblr にアップする

Unity の画面を Animated GIF に変換して Tumblr にアップする

超ニッチですが、メモとして。

Tumblr 側の制限

GIF ファイルの容量を 1MB 未満にしないと再変換されてしまう。よって、いかに容量を小さくするかというのが焦点になる。

  • 画像サイズを小さくする。
  • 色数を少なくする。
@dcastro
dcastro / gist:2835703
Created May 30, 2012 11:36
iOS 3 types of crossfade animations
[UIView animateWithDuration:0.3 animations:^() {
self.commentContentLabel.alpha = (editing)? 0.0 : 1.0;
}];
////////////////
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.commentContentLabel cache:YES];