Skip to content

Instantly share code, notes, and snippets.

View lordhasyim's full-sized avatar
🏠
Working from home

ahmadhasyim lordhasyim

🏠
Working from home
View GitHub Profile
@lordhasyim
lordhasyim / bender-bash-prompt
Created July 2, 2023 15:51 — forked from specious/bender-bash-prompt
A fancy two-line #!/bin/bash prompt with $(git integration)
#
# Fancy two-line prompt with git integration
#
# ┌───=[ specious :: sharp -( 0 )-[ ~ ]-( master )
# └──(
#
git_current_head () {
git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD
}
@lordhasyim
lordhasyim / update-phpstorm.sh
Created December 12, 2022 22:37 — forked from olivertappin/update-phpstorm.sh
Download and install the latest version of PhpStorm for Ubunti
#!/bin/bash
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
echo "Downloading the latest PhpStorm to /tmp"
cd /tmp
@lordhasyim
lordhasyim / change-favicon-from-CSS.js
Created May 4, 2021 03:07 — forked from lapo-luchini/change-favicon-from-CSS.js
Dynamically change favicon from CSS. (does not work on Internet Explorer and Safari)
/*! 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 / add-apt-repository
Created October 10, 2016 06:11
python ppa kali
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
@lordhasyim
lordhasyim / install.sh
Created October 7, 2020 10:56 — forked from jtilly/install.sh
Install qcachegrind on Ubuntu
#!/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 August 14, 2020 14:57 — forked from eusonlito/README.md
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
lordhasyim / Rupiah.as
Created December 23, 2019 07:20 — forked from faisalman/Rupiah.as
Konversi Angka ke format Rupiah & vice versa (C#, PHP, JavaScript, ActionScript 3.0)
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
@lordhasyim
lordhasyim / 1-elementary-os-apps.md
Created October 29, 2019 05:10 — forked from ankurk91/1-elementary-os-apps.md
elementary OS 5.0 Juno

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 October 23, 2019 08:07 — forked from diegonobre/symfony3-rest-api.md
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. v1.api.example.com)

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