$ wget https://gist.githubusercontent.com/hrysd/d10269472a2a62b6fb18/raw/c11247e6ea96305d68f3c1854912c216760c2d69/idobata
$ mv idobata /path/to/playbook/library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: skeleton | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/database.yml b/config/database.yml | |
index 51a4dd4..1c1a37c 100644 | |
--- a/config/database.yml | |
+++ b/config/database.yml | |
@@ -3,23 +3,23 @@ | |
# | |
# Ensure the SQLite 3 gem is defined in your Gemfile | |
# gem 'sqlite3' | |
-development: | |
+# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -e '/childprocess\|erubis\|log4r\|net-scp/s/~>/>=/' \ | |
-e '/net-ssh/s:, "< 2.8.0"::' \ |
DS.ManyArray#createRecord
は createRecord
をもっていてそのままつくれる
DS.PromiseArray
はもってなくて作れないので、ManyArray
にしてあげてから作るのがベストの様子
ManyArray#createRecord
内部で owner
, store
, type
を用意してくれる
App.Post = DS.Model.extend({
comments: DS.hasMany('comment', {async: true})
});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "0.10" | |
before_install: | |
- npm install -g grunt-cli bower | |
- npm install | |
- grunt | |
- npm test |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='\[\033[1;34m\][\w]\[\033[0m\]\[\033[1;32m\]$(__git_ps1)\[\033[00m\]\[\033[1;36m\]>\[\033[0m\] ' |
@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|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mainモジュール | |
# ワーカープロセスを実行するユーザーの指定 | |
user www-data; | |
# ワーカープロセスの数。さくらのVPSのコア数にあわせた。 | |
worker_processes 2; | |
# 全体でのエラーログの詳細度の指定。 | |
error_log logs/error.log notice; |