Skip to content

Instantly share code, notes, and snippets.

View hrysd's full-sized avatar
🤔
hoi

Hiroshi Yoshida hrysd

🤔
hoi
View GitHub Profile
@hrysd
hrysd / Rakefile
Created September 18, 2012 04:46
CC = "gcc"
task :default => "hello"
file "hello" => "hello.o" do
sh "#{CC} -o hello hello.o"
end
file "hello.o" => "hello.c" do
sh "#{CC} -c hello.c"
git push origin :BRACH_NAME
resources :users do
  get 'hoge' # 1
  get ':id/hoge' # 2
end
resources :users do
 collection do
.field_with_errors
@include formFieldState(#b94a48, #ee5f5b, lighten(#ee5f5b, 30%))
@extend .error
@hrysd
hrysd / Gemfile
Last active December 10, 2015 03:08
source :rubygems
gem 'clockwork'
gem 'heroku'
gem 'active_support'
gem 'lingman', git: 'git://github.com/hrysd/lingman.git'
@hrysd
hrysd / Gemfile
Created January 8, 2013 01:29
define_method かっこいい。
source :rubygems
gem 'garb'
gem 'active_support'
@hrysd
hrysd / nginx.conf
Created January 16, 2013 04:41
nginx
# Mainモジュール
# ワーカープロセスを実行するユーザーの指定
user www-data;
# ワーカープロセスの数。さくらのVPSのコア数にあわせた。
worker_processes 2;
# 全体でのエラーログの詳細度の指定。
error_log logs/error.log notice;
@hrysd
hrysd / memo.md
Last active December 13, 2015 21:29
これ知らなかった。
@hoge = Hoge.new(params[:hoge]) do |h|
  h.user = current_user
end

Hoge.create(params[:hoge]) do |h|
  h.user = current_user
end

User.create([{ name: 'hoge'}, { name: 'huga' }, { name: 'piyo' }]) do |u|
@hrysd
hrysd / prompt.sh
Last active December 15, 2015 02:09
export PS1='\[\033[1;34m\][\w]\[\033[0m\]\[\033[1;32m\]$(__git_ps1)\[\033[00m\]\[\033[1;36m\]>\[\033[0m\] '
class Account < ActiveRecord::Base
  with_options :dependent => :destroy do |assoc|
    assoc.has_many :customers
    assoc.has_many :products
    assoc.has_many :invoices
    assoc.has_many :expenses
  end
end