Skip to content

Instantly share code, notes, and snippets.

View mntdamania's full-sized avatar

Manthan Damania mntdamania

View GitHub Profile
@mntdamania
mntdamania / gist:ee76c9261c5f2729ea6c380e58c12931
Created December 21, 2017 14:23
nginx + unicorn + performance tweaks: nginx.conf example
# nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
timer_resolution 500ms;
@mntdamania
mntdamania / fb_reply.rb
Created March 26, 2014 18:48
This script likes and comments on posts posted by your friends. Could be useful while replying for birthday wishes :)
require "koala"
@graph = Koala::Facebook::API.new("fb_app_token")
feed = @graph.get_connections("me", "feed")
feed.each do |f|
@graph.put_like(f["id"]) # like wall post
@graph.put_comment(f["id"], "Thanks a lot :)") # comment on wall post
end
@mntdamania
mntdamania / gist:4417458
Created December 31, 2012 05:03
Active admin bactch action error
Showing /home/User/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.5.0/app/views/layouts/active_admin.html.arb where line #1 raised:
undefined method `get' for nil:NilClass
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:142:in `content_for'
activeadmin (0.5.0) lib/active_admin/views/pages/layout.rb:16:in `main_content'
activeadmin (0.5.0) lib/active_admin/views/pages/base.rb:78:in `block (2 levels) in build_main_content_wrapper'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'