Skip to content

Instantly share code, notes, and snippets.

View mokoaki's full-sized avatar
💭
死にかけ

mokoaki mokoaki

💭
死にかけ
View GitHub Profile
gzip
圧縮
#元ファイルは消える
gzip a.txt
#元ファイル残す
gzip -c a.txt > a.gz
展開
#元ファイルは消える
https://github.com/mikel/mail/blob/master/spec/spec_helper.rb
http://qiita.com/hnakamur/items/d3e32045af17bfe6e215
Ruggedに説明がありますが、以下のように指定します。
gem 'rugged', git: 'git://github.com/libgit2/rugged.git', branch: 'development', submodules: true
submodules: trueの指定によってlibgit2をgithubから取得してコンパイルするようになっています。最初この指定を忘れていたら、homebrewで入れたlibgit2 0.20.0を使ってコンパイルエラーになってしまいました。
あとはbundleでruggedをインストールします。
diff --git a/config/environments/production.rb b/config/environments/production.rb
index a8836c3..b93a877 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -32,7 +32,7 @@ Rails.application.configure do
# Generate digests for assets URLs.
config.assets.digest = true
- # `config.assets.precompile` has moved to config/initializers/assets.rb
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
@mokoaki
mokoaki / mefmo
Created September 17, 2014 06:27
cmd = 'git add'
pid = Process.fork do
Process.exec [cmd, cmd] # コマンド実行
end
Process.waitall # 子プロセスの終了待ち
git cat-file -p 317ed615a10c9e
http://d.hatena.ne.jp/murank/20110327/1301224770
git reset
--soft HEADの位置のみを変更する。インデックス、ワーキングツリーには影響なし。
--mixed(default) HEADの位置とインデックスを変更する。ワーキングツリーには影響なし。
--hard HEADの位置、インデックス、ワーキングツリーをすべて変更する。
git reset --soft HEAD -> HEAD の位置を HEAD に変更し、インデックス、ワーキングツリーはそのままにする。つまり何も変わらない。
git reset --soft HEAD^ -> HEAD の位置が HEAD^ に移動するだけ。 コミットすると --amend した同じ
#まぁBASIC認証なんてもう使わないだろうけど、他の用途で使う時のメモ
url = 'http://www.example.com'
user = 'moko'
pass = 'boke'
url =~ /\Ahttps?:\/\//
"#{$&}#{user}:#{pass}@#{$'}"
#=> "http://moko:boke@www.example.com"
desc 'うんたら'
task :kantara do
puts 'hoge'
end
task :before do
puts 'before'
end
task :after do
#belongs_to 1
class Entry < ActiveRecord::Base
belongs_to :user
end
FactoryGirl.define do
factory :user do
name 'name'
end
sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git tag
git branch
git checkout 1.9
#超時間かかる数時間コース?
./build.sh