Skip to content

Instantly share code, notes, and snippets.

View juno's full-sized avatar
💰
writing code (almost) every weekday

Junya Ogura juno

💰
writing code (almost) every weekday
View GitHub Profile
@mala
mala / gist:5002784
Last active December 14, 2015 00:59
このLEMONってのがrapgeniusの人ね。
http://cache.gyazo.com/91f2e906a220fbeef2e9283b0aee597a.png
Unicorn使っても2workerで動いているところに遅いリクエストが3件来たら詰まるよ!!
根本的な解決にならない!!
とか言ってるんですよ。
じゃあ例えば、並列数1x10と並列数2x5で遅いリクエスト5件投げてキューに詰まる確率を考えてみよう。
絵で表すとこう。絵じゃなくて文字だけど。

@ITやテッククランチがアホすぎてつらい。

要約

Rap GeniusというサービスがHerokuに月額2万ドル払っていて、そのサービスに満足していたという。 内訳はよくわからないが、Herokuの「サクセスストーリー」に公開されているところによると、彼らはWeb用のdynoを120使っているとのこと。 http://success.heroku.com/rapgenius

New Relic(サードパーティのパフォーマンス計測アドオン)には年間 $63116.13 払っているという。

@eltoob
eltoob / gist:4586719
Created January 21, 2013 15:09
Quick lines to get the number of selectors in each CSS to make sure that IE is not breaking
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length;
for (var j = 0; j < totalStyleSheets; j++){
var
styleSheet = styleSheets[j],
rules = styleSheet.cssRules,
totalRulesInStylesheet = rules.length,
totalSelectorsInStylesheet = 0;
class TransactionalExec
attr_accessor :commit_every, :block
def initialize(commit_every, max_lines = nil, verbose = true, &block)
@commit_every = commit_every
@block = block
@max_lines = max_lines
@verbose = verbose
end
@makoto
makoto / gist:4018340
Created November 5, 2012 17:05 — forked from seki/gist:4010665
dRubyConf draft

dRubyConf 2012 参戦日記

こんにちは。「RubyConf参加支援企画プログラム」に採択していただき、デンバーまで行ってきた井上といいます。

今回は私がアメリカのカンファレンスで発表するまでの道のりと、dRubyの作者である関将俊さん(以下「咳」さん)と一緒に聞いてきた他のトークの概要を紹介していきたいと思います。

ちなみに私たちはdRubyに関連するような並列、並行プログラミングやデータベースのトークを中心に参加したので、このカンファレンスは「dRubyConference」という視点で見ていきます。

応募するまでの道のり

@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@mbleigh
mbleigh / matchers.rb
Created September 7, 2012 16:53
RSpec matcher for JSON responses.
RSpec::Matchers.define :have_json_key do |expected_key|
match do |response|
@body = MultiJson.load(response.body)
result = @body.key?(expected_key.to_s)
result &&= @body[expected_key.to_s] == @expected_val if @val_provided
result
end
chain :with_value do |val|
@jugyo
jugyo / gist:3509080
Created August 29, 2012 09:32
とあるプロジェクトで使ったライブラリたち

とある Rails プロジェクトで使ったライブラリたち

  • carrierwave - ファイルアップロードを処理するやつ
  • carrierwave_backgrounder - アップロードされたフィアルの処理(画像のリサイズ等)をバックグラウンドで処理する
  • delayed_job_active_record - バックグラウンド処理
  • fog - AWS との連携に使う。 carrierwave がこれを使って S3 にファイルを保存してくれたりする
  • haml-rails - haml 使いたいねん
  • twitter-bootstrap-rails - あれ
  • will_paginate - ページネーション
  • bootstrap-will_paginate - twitter-bootstrap 的にいい感じのタグを出力してくれる
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

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

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。