Skip to content

Instantly share code, notes, and snippets.

View iqbalhasnan's full-sized avatar
:shipit:
shipit

Iqbal Hasnan iqbalhasnan

:shipit:
shipit
  • Kuala Lumpur, Malaysia
  • 01:50 (UTC +08:00)
View GitHub Profile
@iqbalhasnan
iqbalhasnan / cisco_anny_connect.sh
Created March 2, 2016 00:55
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
iqbalhasnan / gist:f37a78a9f07f401b44bd
Created November 16, 2015 03:24
Failed to click element because of overlapping element
Failed to click element because of overlapping element
change
`page.find("#some_element").click`
to
`page.find("#some_element").trigger("click")`
@iqbalhasnan
iqbalhasnan / spree_backend_install.md
Created November 14, 2015 11:34 — forked from huoxito/spree_backend_install.md
Spree backend install

Set up a Spree backend only install

rails new store-backend

Gemfile

gem 'spree_backend', github: 'spree/spree'
@iqbalhasnan
iqbalhasnan / fix
Created November 4, 2015 09:03
ERROR: Error installing libv8: ERROR: Failed to build gem native extension.
El-Capitan
gem install libv8 -v '3.11.8.17' -- --with-system-v8
@iqbalhasnan
iqbalhasnan / production.rb
Created August 26, 2015 02:55
Rails 3 Upgrade To Rails 4 minify CSS and JS
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@iqbalhasnan
iqbalhasnan / user.rb
Created January 18, 2015 23:37
reserved username
RESERVED_WORDS = ["admin", "users","help", "about", "account", "login", "signup", "logout", "edit", "index",
"stylesheets","account","reset", "assets", "javascripts", "images", "privacy",
"a", "about", "tos","contact","comments","likes","photos","albums","popular", "tour", "activity", "discover", "annotations", "activities", "notifications", "follower_requests"]
validates :username, presence: true, format: { with: USERNAME_REGEX, message: "Your username can only contain letters A-Z, numbers 0-9, and underscores."}, length: { maximum: 15 }, uniqueness: { case_sensitive: false, message: "That username is not available"}, exclusion: { in: RESERVED_WORDS, message: "\"%{value}\" is reserved."}
@iqbalhasnan
iqbalhasnan / Cloudflare full SSL + NGINX + RAILS
Created January 18, 2015 11:28
NGINX HTTPS AND NON-WWW CLOUDFLARE
BEHAVIOUR:
http://reka.co -> https://reka.co
http://www.reka.co -> https://reka.co
https://www.reka.co -> https://reka.co
MAKE SURE YOU SET CLOUDFLARE SLL TO (FULL STRICT)
upstream unicorn {
server unix:/tmp/unicorn.appsname.sock fail_timeout=0;
}
This gist is the update of this post https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/
License MIT
rvm use --create —ruby-version 1.9.3-p550@wrapper