Skip to content

Instantly share code, notes, and snippets.

Working from home

ahmadhasyim lordhasyim

Working from home
View GitHub Profile
lordhasyim / change-favicon-from-CSS.js
Created May 4, 2021 — forked from lapo-luchini/change-favicon-from-CSS.js
Dynamically change favicon from CSS. (does not work on Internet Explorer and Safari)
View change-favicon-from-CSS.js
/*! dynamically change favicon from CSS (does not work on Internet Explorer and Safari)
* use with:
* <link id='linkCSS' href='my.css' type='text/css' rel='stylesheet' />
* <link id='favicon' rel="shortcut icon" href="../images/favicon.png" type="image/png" />
* my.css can contain:
* #favicon { background-image: url(any valid URL); }
lordhasyim /
Created Oct 7, 2020 — forked from jtilly/
Install qcachegrind on Ubuntu
sudo apt-get install qt5-default
tar xvf kcachegrind-0.7.4.tar.gz
cd kcachegrind-0.7.4
qmake && make
sudo install -m 755 qcachegrind/qcachegrind /usr/local/bin
sudo install -m 644 qcachegrind/qcachegrind.desktop \
lordhasyim /
Created Aug 14, 2020 — forked from eusonlito/
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.

This is an example of a web that uses a remote API as a database wrapper.

The remote API is stateless and the web uses cookies to maintain session persistence.

The API authentication endpoint returns a TOKEN that allows the web to make each request to the API with the user authentication header.

Este es un ejemplo de web que usa una API remota como wrapper de base de datos.

lordhasyim /
Created Dec 23, 2019 — forked from faisalman/
Konversi Angka ke format Rupiah & vice versa (C#, PHP, JavaScript, ActionScript 3.0)
* ActionScript 3.0 Code Snippet
* Convert Number to Rupiah & vice versa
* Copyright 2011-2012, Faisalman
* Licensed under The MIT License

elementaryOS Apps and Configs

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common

Install original plank dock

lordhasyim /
Created Oct 23, 2019 — forked from diegonobre/
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g.

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

lordhasyim /
Created Oct 17, 2019 — forked from frfahim/
Install fish shell and oh-my-fish on ubuntu

First install fish shell on your system

sudo apt-get update
sudo apt-get install fish

Or install fish via ppa

sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update
sudo apt-get install fish``
lordhasyim / gist:5c0baa1b9b89a00009093988836b1781
Created Aug 4, 2019 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:5c0baa1b9b89a00009093988836b1781


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
lordhasyim /
Created Aug 4, 2019 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
View gist:4054ab6ac5567d9e4c615f9533808b19
Run this
"sudo -u postgres psql"
in your terminal to get into postgres
Run "CREATE USER new_username;"
Note: Replace new_username with the user you want to create,