Skip to content

Instantly share code, notes, and snippets.

View voluntas's full-sized avatar
🎲
Focusing

V voluntas

🎲
Focusing
View GitHub Profile
-module(prop_snowflake_mnesia).
-author('@voluntas').
-export([initial_state/0,
command/1,
precondition/2,
next_state/3,
postcondition/3]).
@voluntas
voluntas / spam.rst
Created April 29, 2011 02:26
sample

spam

  • a
  • b
=== Entering application hipe
erlc -W +debug_info +warn_exported_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_consttab.erl
(no error logger present) error: "Error in process <0.1.0> with exit value: {{badfun,[<<5 bytes>>,<<48 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2 bytes>>,<<5 bytes>>,<<12 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8 bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2 bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<52 bytes>>,<<5 bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<18 bytes>>,<<7 bytes>>,<<17 bytes>>,<<7 bytes>>,<<19 bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<17 bytes>>]},[{erlang,apply,2}]}\n"
@voluntas
voluntas / gist:1102349
Created July 24, 2011 06:56
sphinx-on-fluxflex
.flx
Writing objects: 100% (6/6), 564 bytes, done.
[deploy]
pip install -r req.txt -I --install-option="--user"
make html
Makefile
# You can set these variables from the command line.
@voluntas
voluntas / gist:1102447
Created July 24, 2011 09:37
関数のシリアライズ
Eshell V5.8.4 (abort with ^G)
1> F = fun() -> ok end.
#Fun<erl_eval.20.21881191>
2> erlang:term_to_binary(F).
<<131,112,0,0,2,139,0,251,3,184,152,93,16,176,57,2,110,24,
202,39,247,72,160,0,0,0,1,0,0,...>>
3> erlang:binary_to_term(erlang:term_to_binary(F)).
#Fun<erl_eval.20.21881191>
# vim: fileencoding=utf8
import csv
import cStringIO
def get_csv_data():
return make_data()
def make_file():
data = cStringIO.StringIO()
@voluntas
voluntas / Issue.txt
Created September 6, 2011 16:31 — forked from taichi/idea.txt
Koshinuke memo
マイルストーン > タスク > チケット
マイルストーンはマスタースケジュール、これをタスクに分割する。
マイルストーンの名前でリリース用のブランチが自動的に作成される。
マイルストーンを完了するとマイルストーンの名前で自動的にtagが作成される。
タスクは個人の作業単位、最小のタスクは最大でも1週間程度で終わる先の見える見積もり可能な大きさの作業になる。
要件を具体的な作業単位に落とす中間的なタスクが存在する。つまり、タスクはタスク間の関連性をN:Mマッピング出来る。
@voluntas
voluntas / gist:1227236
Created September 19, 2011 18:44
erjang 使ってみた
% java -jar erjang-0.1-otp-R14B02.jar
Eshell V5.7.5 (abort with ^G)
1> erlang:now().
{1316,457614,333466}
2> os:timestamp().
{1316,457619,725469}
3> mnesia:start().
ok
4> rd(store, {key, value}).
store
@voluntas
voluntas / gist:1234880
Created September 22, 2011 14:18
simplejson.loads
Python 2.6.6 (r266:84292, Jun 16 2011, 16:59:16)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.__version__
'1.9'
>>> json.loads('[["spam","eggs"]]')
[[u'spam', u'eggs']]
Python 2.7.1 (r271:86832, Dec 11 2010, 20:55:42)
@voluntas
voluntas / gist:1234920
Created September 22, 2011 14:33
sample.py
import riak
client = riak.RiakClient(port=8087, transport_class=riak.RiakPbcTransport)
bucket = client.bucket('bucket')
john = bucket.new('john', {'name': 'john', 'job': 'programmer', 'age': '27'})
john.set_indexes({'job_bin': 'programmer', 'age_int': 31})
john.store()
results = client.index('bucket', 'age_int', 30, 50).run()