Skip to content

Instantly share code, notes, and snippets.

@tarky
tarky / Gemfile.lock
Created November 7, 2015 11:25
wrap_layout doesn't work as the document.
GEM
remote: http://rubygems.org/
specs:
activesupport (4.2.4)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
@tarky
tarky / gist:83bae740a2d132360e1b
Created August 25, 2015 07:34
style for free blogs
a.afilink{
font-weight: bold;
font-size: 150%;
color: #0000ff !important;
text-decoration: underline;
}
a.afilink:visited { color: #000080 !important; }
a.afilink:hover { color: #ff0000 !important; }
a.afilink:active { color: #ff8000 !important; }
@tarky
tarky / gist:d8caf2997db85ea68f29
Created July 29, 2015 02:28
logging console work
script result.log
do something
exit
@tarky
tarky / gist:ce3dd5c0799f9bb6a437
Last active August 29, 2015 14:26
destory item without user
models = %w(Theme Entry Vote Activity Feed Follow Notification Authentication)
models.each do | model |
model.constantize.all.each do | obj |
if obj.user.nil?
puts "User #{obj.user_id} doesn't exist. So destroy #{model} #{obj.id}"
obj.destroy
end
end
end
Follow.all.each do | obj |
@tarky
tarky / gist:ed97e3ded412a854c73d
Created June 23, 2015 08:17
Error when deploy on OpsWorks
[2015-06-23T08:08:36+00:00] INFO: Report handlers complete
---
[2015-06-23T08:08:38+00:00] INFO: Starting chef-zero on port 8889 with repository at repository at /opt/aws/opsworks/current
One version per cookbook
data_bags at /var/lib/aws/opsworks/data/data_bags
nodes at /var/lib/aws/opsworks/data/nodes
[2015-06-23T08:08:38+00:00] INFO: Forking chef instance to converge...
@tarky
tarky / gist:c343913082cf6ca615f0
Created June 23, 2015 06:40
Error on Opsworks
2015-06-23T06:29:40+00:00] INFO: sudo su - deploy -c 'cd /srv/www/inq/releases/20150623062934 && /usr/local/bin/bundle install --path /home/deploy/.bundler/inq --without=test development'
================================================================================
Error executing action `deploy` on resource 'deploy[/srv/www/inq]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '5'
@tarky
tarky / gist:3e201b9b455defeea2a0
Created June 22, 2015 12:03
Rails admin はなぜか一般ユーザ用のログイン画面が出ちゃう。
Rails admin はなぜか一般ユーザ用のログイン画面が出ちゃう。Rails admin はなぜか一般ユーザ用のログイン画面が出ちゃう。
@tarky
tarky / gist:b76b9f1935085d884665
Created June 22, 2015 07:45
error when adding activeadmin
1 || Fetching gem metadata from https://rubygems.org/.........
2 || Fetching version metadata from https://rubygems.org/...
3 || Fetching dependency metadata from https://rubygems.org/..
4 || Resolving dependencies......
5 || Your Gemfile requires gems that depend on each other, creating an infinite loop. Please remove gem 'meta_search' and try again.
y
@tarky
tarky / gist:5dbceb201cbf1e422293
Created June 22, 2015 06:41
error when deploy
[2015-06-22T05:07:45+00:00] INFO: sudo su - deploy -c 'cd /srv/www/inq/releases/20150622050739 && /usr/local/bin/bundle install --path /home/deploy/.bundler/inq --without=test development'
================================================================================
Error executing action `deploy` on resource 'deploy[/srv/www/inq]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
@tarky
tarky / gist:9883382bb5df35362790
Created June 22, 2015 04:56
Hirbのno method error
https://github.com/pry/pry/issues/1265#issuecomment-76188820
これで治る。