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
  • 08:18 (UTC +08:00)
View GitHub Profile
@iqbalhasnan
iqbalhasnan / Dockerfile
Last active November 12, 2021 15:12
Rails 6 Docker Image - Ruby 3, Postgres, Webpack https://hub.docker.com/r/iqbalhasnan/rails-6-dev
FROM ruby:3.0.2-alpine
ENV ROOT=/var/www/app \
BUNDLE_PATH=/var/www/app/vendor/bundle
ENV BUNDLE_BIN=$BUNDLE_PATH/bin
ENV PATH $ROOT/bin:$BUNDLE_BIN:$PATH
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
@iqbalhasnan
iqbalhasnan / gist:ed92fa2450cab9c5b63d2402f3ff2c72
Created February 25, 2020 00:46
Spark Hive errors and solutions
1.
Error:
java.io.IOException: java.lang.IllegalArgumentException: bucketId out of range: -1
Solution:
set hive.fetch.task.conversion=none;
2.
Error:
java.io.IOException: [Error 30022]: Must use HiveInputFormat to read ACID tables
@iqbalhasnan
iqbalhasnan / gist:dcd034a2ef300df65fe71baf3adafd4f
Created March 23, 2017 03:45
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
ERROR
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
FIX
brew update && brew install gmp && rvm reinstall 2.2.5
@iqbalhasnan
iqbalhasnan / gist:5e859772e6014bc6e17630fe207001ba
Created February 2, 2017 14:48
Capistrano 3 - Changed Repository URL Fix
1 ) remove /home/deployer/appName/repo
2 ) cap production deploy
@iqbalhasnan
iqbalhasnan / carrierwave.rb
Created January 10, 2017 16:00
Uninitialized Constant Carrierwave::Storage::Fog
# Before
CarrierWave.configure do |config|
config.storage = :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
iqbalhasnan / option_groups_from_collection_for_select.rb
Created January 7, 2017 00:38
ActiveAdmin Group Select With Formstatic
class Category < ApplicationRecord
has_many :types
end
class Type < ApplicationRecord
belongs_to :category
end
# Admin DSL. you need to pass the the selected type_id by passing the form object value.
f.input :category
@iqbalhasnan
iqbalhasnan / Capistrano 3.md
Created August 17, 2016 13:18 — forked from stevenyap/Capistrano 3.md
Capistrano 3 Setup

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
@iqbalhasnan
iqbalhasnan / tmux-cheatsheet.markdown
Created June 15, 2016 04:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@iqbalhasnan
iqbalhasnan / gist:18495b8cd60313f826acf980be85dd69
Created June 13, 2016 14:23
Exception in callback of async function: Error: Handler with name 'u' already exists.
Exception in callback of async function: Error: Handler with name 'u' already exists.
Run this to fix above error:
meteor update iron:middleware-stack
@iqbalhasnan
iqbalhasnan / capybara cheat sheet
Created April 28, 2016 03:43 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')