Skip to content

Instantly share code, notes, and snippets.

View ojimac's full-sized avatar

Keita Ojima ojimac

View GitHub Profile
@technolize
technolize / github-follow-organization.user.js
Created April 21, 2012 16:12
github の organization ページにもフォローボタンを表示する
// ==UserScript==
// @name follow organization
// @description Show follow button on github organization page
// @namespace http://www.technolize.net/
// @include https://github.com/*
// @version 0.1
// @license MIT License
// @work Google Chrome
// ==/UserScript==
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@brianhempel
brianhempel / all_s3_objects.rb
Created March 21, 2012 15:21
List/fetch all objects in a bucket with AWS::S3 Ruby gem
# by default you only get 1000 objects at a time
# so you have to roll your own cursor
S3.connect!
objects = []
last_key = nil
begin
new_objects = AWS::S3::Bucket.objects(bucket_name, :marker => last_key)
objects += new_objects
@bleis-tift
bleis-tift / git-start
Created February 13, 2012 09:15
空コミットを最初のコミットとして作るコマンド(git initの代わり)
#!/bin/sh
msg=${1:-"first commit"}
git init
tree_hash=$(git write-tree)
commit_hash=$(echo -n "$msg" | git commit-tree $tree_hash)
echo $commit_hash > .git/refs/heads/master
@steipete
steipete / gist:1397553
Created November 27, 2011 13:28
Ugly as hell workaround for UIWebView crashing on non-main thread dealloc (inside a UIView)
- (void)dealloc {
webView_.delegate = nil; // delegate is self here, so first set to nil before call stopLoading.
[webView_ stopLoading];
// UIWebView must be released in the main thread, or we get:
// Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
// This is less evil than the proposed http://stackoverflow.com/questions/945082/uiwebview-in-multithread-viewcontroller
// Calling removeFromSuperview in a dealloc is ugly and evil, but else UIView has a strong reference to UIWebView and our main-release call would be irrelevant.
if (![NSThread isMainThread]) {
[webView_ performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES];
@ahmetardal
ahmetardal / UIWebViewHttpStatusCodeHandling_checksession.m
Created August 18, 2011 11:17
UIWebViewHttpStatusCodeHandling
#pragma mark -
#pragma mark UIWebViewDelegate Methods
- (BOOL) webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType
{
if (_sessionChecked) {
[self log:@"session already checked."];
return YES;