Skip to content

Instantly share code, notes, and snippets.

View tyabe's full-sized avatar
💤
zzz

Takeshi Yabe tyabe

💤
zzz
  • STORES, Inc.
  • Tokyo Japan
  • X @tyabe
View GitHub Profile
@nesquena
nesquena / jbuilder.rb
Created February 14, 2012 01:15
JBuilder and RABL Syntax Comparison
Jbuilder.encode do |json|
json.content format_content(@message.content)
json.(@message, :created_at, :updated_at)
json.author do |json|
json.name @message.creator.name.familiar
json.email_address @message.creator.email_address_with_name
json.url url_for(@message.creator, format: :json)
end
#! /usr/bin/env ruby
# coding: utf-8
require 'sinatra/base'
require 'active_resource'
require 'haml'
class MAService < ActiveResource::Base
self.site = 'http://jlp.yahooapis.jp'
DEFAULT_PARAMS = {
@satococoa
satococoa / gist:2347993
Created April 10, 2012 02:33
tmuxで画面を4分割しつつコマンド実行
#!/bin/zsh
tmux new-window -n name # 新しいwindowを開きたくない場合は以下
# tmux rename-window name
tmux split-window -h
tmux split-window -v -t name.0
tmux split-window -v -t name.1
tmux send-keys -t name.0 'echo 0' C-m
tmux send-keys -t name.1 'echo 1' C-m
tmux send-keys -t name.2 'echo 2' C-m
@esehara
esehara / gist:3160352
Created July 22, 2012 17:21
良い Commit Messageを書きましょう(翻訳)

by https://github.com/erlang/otp/wiki/Writing-good-commit-messages

良いコミットメッセージは、重要な役割が、少なくとも三つあります。

  • レビューするプロセスをスピードアップする。
  • 良いリリースノートを書く手助けになる。
  • 将来、Erlang/OTPのメンテナンスを手助けするため(もしかしたら君かも!)。それは五年後の未来において、なんでコードの中で特定の変更が加えられたのか、あるいは特定の機能が追加されたのか見つけるため、ということ。
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

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

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@turadg
turadg / subdomains.rb
Last active January 21, 2024 19:45 — forked from rtekie/subdomains.rb
Drop-in utility to test your app subdomains with Capybara, Rspec, and a Javascript driver (Poltergeist, Webkit, or Selenium)
# Support for Rspec / Capybara subdomain integration testing
# Make sure this file is required by spec_helper.rb
# (e.g. save as spec/support/subdomains.rb)
def switch_to_subdomain(subdomain)
# lvh.me always resolves to 127.0.0.1
hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me"
Capybara.app_host = "http://#{hostname}"
end
@sunaot
sunaot / exception.md
Created August 2, 2013 09:13
例外設計の話

例外設計の話。

こんな指針がいいのかなー 2013 夏 ver.

例外の目的とは?

.NET の「例外のデザインのガイドライン」にもこう書いてある。

<div class="container">
<% if flash[:notice] %>
<div class="alert alert-success">
<%= flash[:notice] %>
</div>
<% end %>
<h1>Users</h1>
<%= form_for(@user_import, url: import_admin_users_path,
html: {method: :post, multipart: true, role: "form", class: "form-inline"}) do |f| %>