Skip to content

Instantly share code, notes, and snippets.

View hasibomi's full-sized avatar

Hasibur Rahman Omi hasibomi

View GitHub Profile
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "Andorra", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@hasibomi
hasibomi / unserialize.js
Created November 20, 2016 09:32
Unserialize php's serialized array in javascript.
function unserialize(array) {
var accumulated_array = [];
for (var j = 0; j < array.split('{')[1].split(';').length; j++) {
var sp = array.split('{')[1].split(';');
var np = sp[j].split(':');
for (var k = 0; k < np.length; k++) {
if (k != 0 && k % 2 == 0) {
if (np[k] == '"http' || np[k] == '"https') {
@hasibomi
hasibomi / angular-foundation-datepicker.js
Last active December 13, 2016 18:49
Angular directive for Zurb Foundation Datepicker
/**
* Author: Hasibur Rahman Omi.
* Email: me@hasibomi.com.
* Author URI: http://www.hasibomi.com.
*/
class FoundationDatepicker {
constructor() {
this.restrict = "E";
this.replace = true;
@hasibomi
hasibomi / states_hash.json
Created January 6, 2017 17:55 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@hasibomi
hasibomi / changeurl.js
Last active July 20, 2023 22:47
Change URL in Browser Address Bar without reloading using JavaScript and jQuery
/* The solution found here: http://www.aspsnippets.com/Articles/Change-URL-in-Browser-Address-Bar-without-reloading-using-JavaScript-and-jQuery.aspx */
/** HTML5 History pushState method
* The pushState method works similar to window.location but it does not refresh or reload the page and it will modify the URL even if the page does not exists. The pushState method actually inserts an entry into the history of the browsers which allows us to go back and forth using the browser’s forward and back buttons.
* The pushState method accepts the following three parameters.
* 1. State object: - The state object is a JavaScript object which can contain any details about the page and must be serializable.
* 2. Title: - The title of the page.
* 3. URL – The URL of the page.
*/
@hasibomi
hasibomi / datetime-example.js
Last active October 27, 2017 22:17
Date time example for javascript
const currDateTime = Date.now();
const dateTime = new Date(currDateTime);
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
@hasibomi
hasibomi / amazon-ec2-ftp.md
Created November 1, 2017 09:58 — forked from gunjanpatel/amazon-ec2-ftp.md
amazon ec2 LAMP and FTP installation and setup
@hasibomi
hasibomi / wp-permission.md
Last active October 2, 2018 11:39
Wordpress permission for bitnami
  • sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs/<wp-installation>
  • sudo find /opt/bitnami/apache2/htdocs/<wp-installation> -type f -exec chmod 664 {} \;
  • sudo find /opt/bitnami/apache2/htdocs/ -type d -exec chmod 775 {} \;
@hasibomi
hasibomi / lamp-stack.sh
Last active October 19, 2022 08:53
LAMP Stack installation script. It will work on linux environment & has been tested on Ubuntu 20.2. Download `lamp-stack.sh` file. & run `chmod 755 lamp-stack.sh` to make it executable.
#!/bin/sh
# Author: Hasibur Rahman Omi
# Email: me@hasibomi.com
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install apache2