Skip to content

Instantly share code, notes, and snippets.


Iqbal Hasnan iqbalhasnan

Block or report user

Report or block iqbalhasnan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iqbalhasnan / gist:dcd034a2ef300df65fe71baf3adafd4f
Created Mar 23, 2017
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
View gist:dcd034a2ef300df65fe71baf3adafd4f
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
brew update && brew install gmp && rvm reinstall 2.2.5
iqbalhasnan / gist:5e859772e6014bc6e17630fe207001ba
Created Feb 2, 2017
Capistrano 3 - Changed Repository URL Fix
View gist:5e859772e6014bc6e17630fe207001ba
1 ) remove /home/deployer/appName/repo
2 ) cap production deploy
iqbalhasnan / carrierwave.rb
Created Jan 10, 2017
Uninitialized Constant Carrierwave::Storage::Fog
View carrierwave.rb
# Before
CarrierWave.configure do |config| = :fog
config.fog_credentials = {
:provider => "AWS",
:aws_access_key_id => ENV["S3_KEY"],
:aws_secret_access_key => ENV["S3_SECRET"],
:region => ENV["S3_REGION"]
config.fog_directory = ENV["S3_BUCKET"]
iqbalhasnan / option_groups_from_collection_for_select.rb
Created Jan 7, 2017
ActiveAdmin Group Select With Formstatic
View option_groups_from_collection_for_select.rb
class Category < ApplicationRecord
has_many :types
class Type < ApplicationRecord
belongs_to :category
# Admin DSL. you need to pass the the selected type_id by passing the form object value.
f.input :category
View Capistrano

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
iqbalhasnan / gist:18495b8cd60313f826acf980be85dd69
Created Jun 13, 2016
Exception in callback of async function: Error: Handler with name 'u' already exists.
View gist:18495b8cd60313f826acf980be85dd69
Exception in callback of async function: Error: Handler with name 'u' already exists.
Run this to fix above error:
meteor update iron:middleware-stack
View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
iqbalhasnan /
Created Mar 2, 2016
Cisco AnyConnect Command Line
# Connect
printf "USERNAME\nPASSWORD\ny" | /opt/cisco/anyconnect/bin/vpn -s connect HOST
# Disconnect
/opt/cisco/anyconnect/bin/vpn disconnect
iqbalhasnan / gist:f37a78a9f07f401b44bd
Created Nov 16, 2015
Failed to click element because of overlapping element
View gist:f37a78a9f07f401b44bd
Failed to click element because of overlapping element
You can’t perform that action at this time.