Skip to content

Instantly share code, notes, and snippets.

View mdaisuke's full-sized avatar
:octocat:
write code

mdaisuke mdaisuke

:octocat:
write code
View GitHub Profile
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end
@mdaisuke
mdaisuke / gist:1808166
Created February 12, 2012 11:54 — forked from novi/gist:1805373
Node.js 開発環境 基礎

Node.js 開発環境 基礎

Node.jsのインストール

OS X ならHomebrewまたはMacportsで。

[~] $ brew install node
[~] # port install node

nodeコマンドでnodeのインタプリタを起動。

#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に感謝したいと思う

@mdaisuke
mdaisuke / forth.py
Created May 1, 2012 16:18 — forked from tokoroten/forth.py
forth interpriter implimented by python.
# -*- coding: utf-8 -*-
import re
class forth():
Stack = []
FunctionList = {}
VariableList = {}
ParsedCode = []
@mdaisuke
mdaisuke / code_reading.md
Created May 15, 2012 22:06 — forked from taichi/code_reading.md
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@mdaisuke
mdaisuke / faraday.md
Created May 23, 2012 14:49 — forked from rummelonp/faraday.md
Ruby での API ライブラリの開発に Faraday が便利

Ruby での API ライブラリの開発に Faraday が便利

API ラッパの開発には RestClient gem だとか
OAuth の必要なものは Net/HTTP + OAuth gem を使ってた

Twitter gemInstagram gem のなど API ライブラリのソースを読んでみると
Faraday gem というものがよく使われてた

なんとなく気になったので Faraday について調べてみた
ついでに Tumblife gem を Faraday を使うようにした

@mdaisuke
mdaisuke / bot.rb
Created September 14, 2012 04:33 — forked from zh/bot.rb
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end
@mdaisuke
mdaisuke / hipchat_bot.js
Created September 14, 2012 15:32 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@mdaisuke
mdaisuke / ios6-timers.js
Created September 27, 2012 09:56 — forked from ronkorving/ios6-timers.js
iOS6 webkit timer bug workaround
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is free to use by anyone (MIT, blabla).
// Author: rkorving@wizcorp.jp
var timeouts = {};
var intervals = {};

The Ying-Yang of CEOs and Engineers

All successful startups begin with two founders. One guy is the Engineer, and the other guy is the business dude. Over the years of working with various people, I've learned what makes a good engineer, and what makes a good business dude, and the two are complete opposites of each other.

CEO Engineer