Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

ahmadhasyim lordhasyim

🏠
Working from home
View GitHub Profile
@lordhasyim
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
lordhasyim / install.sh
Created Oct 7, 2020 — forked from jtilly/install.sh
Install qcachegrind on Ubuntu
View install.sh
#!/bin/bash
sudo apt-get install qt5-default
wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz
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 \
/usr/local/share/applications/
@lordhasyim
lordhasyim / README.md
Created Aug 14, 2020 — forked from eusonlito/README.md
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.
View README.md

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
lordhasyim / Rupiah.as
Created Dec 23, 2019 — forked from faisalman/Rupiah.as
Konversi Angka ke format Rupiah & vice versa (C#, PHP, JavaScript, ActionScript 3.0)
View Rupiah.as
package
{
/**
* ActionScript 3.0 Code Snippet
* Convert Number to Rupiah & vice versa
* https://gist.github.com/845309
*
* Copyright 2011-2012, Faisalman
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
View 1-elementary-os-apps.md

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
lordhasyim / symfony3-rest-api.md
Created Oct 23, 2019 — forked from diegonobre/symfony3-rest-api.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
View symfony3-rest-api.md

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. v1.api.example.com)

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

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

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
lordhasyim / gist:5c0baa1b9b89a00009093988836b1781
Created Aug 4, 2019 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:5c0baa1b9b89a00009093988836b1781

People

: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
lordhasyim / postgres-cheatsheet.md
Created Aug 4, 2019 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

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
postgres=#
Run "CREATE USER new_username;"
Note: Replace new_username with the user you want to create,