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
@juno
juno / capture.sh
Created February 12, 2014 09:08
Mac OS Xでのパケットキャプチャ。
sudo tcpdump -i en0 -s 0 -B 524288 -w ~/Desktop/dump.pcap

Statesman: A modern, robust Ruby state machine — GoCardless Blog

  • 要件を満たす既存のステートマシン実装が無かった
    • 他のRubyオブジェクトと容易に組み合わせられる
      • ステートマシンを独立したクラスとして実装し、それらをRailsモデルに選択的に組み込みたい
    • データベースレベルでのデータ完全性
      • 復数のアプリケーションサーバーを稼働しているので、レースコンディションに関わる状態変化を防ぐためデータベースでの一貫性を利用したい
    • 状態遷移を追うことができる完全な履歴
      • 各遷移における非構造化メタデータとともに遷移をデータベースに永続化したい
  • Statesmanはrobust audit trailとデータ完全性のために設計された

Our principles for BEM + Sass - 14islands

14islandsはresponsive.ioを運営している、スウェーデンのフロントエンドWeb開発会社。

  • 14islandsではMindBEMdingベースのアプローチを採用
  • Sassも使っている
  • BEM+SassでCSSを構造化するためにいくつかの原則がある

原則1 セレクタにはIDでも要素でもなくクラスを用いる (Classes as selectors, not ids or element tags)

  • セレクタには、IDや要素(タグ)ではなくCSSクラスを使っている

ド・モルガンの法則で条件式を明瞭にする

def allow_access_to_site?
  ! (signed_out? && untrusted_ip?)
end

One:

heroku pipelinesを導入する

qnyp-ural-stagingでpipelinesを有効にする。

$ heroku labs:enable pipelines -a qnyp-ural-staging

Enabling pipelines for junyaogura@gmail.com... done
WARNING: This feature is experimental and may change or be removed without notice.
For more information see: https://devcenter.heroku.com/articles/using-pipelines-to-deploy-between-applications