Skip to content

Instantly share code, notes, and snippets.

View zulhfreelancer's full-sized avatar

Zulhilmi Zainudin zulhfreelancer

View GitHub Profile
@zulhfreelancer
zulhfreelancer / uninstall_brew_package.md
Created December 3, 2015 15:46
How to uninstall Brew packages?
  1. brew list

  2. brew uninstall [package_name]

@zulhfreelancer
zulhfreelancer / what_to_do.md
Last active December 4, 2015 07:54
[Rails] Javascript & jQuery not working on Heroku because of 'Cannot read property 'msie' of undefined' error' - what to do?
@zulhfreelancer
zulhfreelancer / rails_submit_button.md
Last active December 9, 2015 07:58
How to add class to Rails form helper submit button?
First option:

<%= f.submit 'name of button here', :class => 'submit_class_name_here' %>

Second option:

<%= f.submit class: 'submit_class_name_here' %>


@zulhfreelancer
zulhfreelancer / string.md
Last active January 8, 2016 09:35
Ruby: Get string characters remaining after first symbol/punctuation

Get string characters after first symbol/punctuation

Let say you want to get abcd123456789 from this string "access_token:abcd123456789"

string = "access_token:abcd123456789"

You can do it like so:

@zulhfreelancer
zulhfreelancer / app.js
Last active April 22, 2016 09:28
Poslaju API V2 (jQuery only) // Demo: http://jsbin.com/futinayape/edit?html,js,output
$(function() {
$("#trackBtn").on("click", function(){
var tracking_num = $("#tracking_number").val();
if ($.trim(tracking_num).length === 0) {
alert("Tracking number is empty!");
} else {
getTracking(tracking_num);
}
@zulhfreelancer
zulhfreelancer / buggy_scroll_fix.md
Created January 22, 2016 07:04
How to fix buggy scroll problem in mobile Chrome/Safari browser?

Put this inside body or html CSS:

overflow-y: scroll;
overflow-x: hidden; 
-webkit-overflow-scrolling: touch;

Example:

@zulhfreelancer
zulhfreelancer / nokogiri.md
Last active February 14, 2020 23:06
libiconv is missing error when installing Nokogiri on OSX El-Capitan
How to solve libiconv is missing error when installing Nokogiri on Mac OSX El Capitan

Note: Make sure you have Homebrew installed.

If you're getting libiconv is missing error, run this commands:

brew install libiconv
brew link libiconv
@zulhfreelancer
zulhfreelancer / pg_gem_fix.md
Last active February 26, 2016 16:38
How to fix can't install pg gem libpq error in OSX Yosemite?

Option 1

Run this inside the terminal:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install pg

OR:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install pg

@zulhfreelancer
zulhfreelancer / vertical_line.md
Created February 4, 2016 10:24
How to make a vertical line in HTML?
@zulhfreelancer
zulhfreelancer / index.html
Created February 8, 2016 18:41
How to load external website page using iFrame with a fixed top bar? // Demo: http://embed.plnkr.co/iQQPh92IMjCUoeKK6dac/ // Reference: https://perishablepress.com/embed-external-content-via-iframe-and-div/
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="position:absolute; left:77; top:77; width:377; height:377; clip:rect(0,381,381,0); background:#FFF;">
<div class="fixed">FIXED NAVIGATION BAR</div>