$ brew install groonga
Ruby から groonga を使うために rroonga というライブラリを使う:
# Outputs this at warn log level: | |
# 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]} | |
# | |
# Save as config/initializers/oneline_detailed_logging.rb. Consider | |
# decreasing the log level from "info" to "warn" (in production.rb) so | |
# the one-line log message replaces the standard request logs. | |
# override process_action to add 2 things to the payload: | |
# - remote IP |
原文: | http://www.hanselman.com/blog/ProductivityVsGuiltAndSelfLoathing.aspx |
---|---|
著者: | Scott Hanselman |
罪の意識が迫ってきます。あなた以外の皆が物事を片づけているように見えます。あなたは自分をベッドから引きずり出し、会社に行き、Eメールをチェックし始め、削除しだし、そしてあっという間にお昼です。昼食を、もしかしたら自分のデスクで摂り、幾つかのひどい会議に出席し、もう3時です。そこから 本 当 に 働き始め、いい感じになってきたなと感じてきたところで5時か6時になっています。もう帰り始める時間です。今日は本当に何もできなかったと感じるので、残業して―今日みたいに―取り返そうとするでしょう。
ActionDispatch::Request.any_instance.stub(:remote_ip).and_return("192.168.0.1") |
# -*- encoding: utf-8 -*- | |
Gem::Specification.new do |s| | |
s.name = 'parallel_assets_compiler' | |
s.version = '0.2.0' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Jørgen Orehøj Erichsen' | |
s.email = '[email protected]' | |
s.summary = 'Compile assets in parallel' | |
s.description = 'Compile assets in parallel to speed up deployment' |
# -*- coding: utf-8 -*- | |
# earthquake.gem plugin | |
# add url to Pocket(http://getpocket.com) | |
require 'uri' | |
require 'open-uri' | |
Earthquake.init do | |
cfg = config[:pocket] || {} | |
command :pocket do |m| | |
pocket_uri = URI.parse('https://readitlaterlist.com/v2/add') |
#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に感謝したいと思う
# Adds support for http digest authentication in Rails 3 | |
# Inspired by: http://lightyearsoftware.com/2009/04/testing-http-digest-authentication-in-rails/ | |
# Place this code in test/test_helper.rb | |
# In your test, call authenticate_with_http_digest prior to calling get, post, put or delete | |
# Tested with Rails 3.0.7 | |
class ActionController::TestCase | |
require 'digest/md5' | |
def authenticate_with_http_digest(user = API_USERNAME, password = API_PASSWORD, realm = API_REALM) |