Skip to content

Instantly share code, notes, and snippets.

View haifahrul's full-sized avatar
💭
Open to work

Ahmad Fakhrurozi S haifahrul

💭
Open to work
View GitHub Profile
@haifahrul
haifahrul / index.php
Created April 9, 2020 15:41
Yii2 Basic Web for Hosting
<?php
file_put_contents('.htaccess', <<<END
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/.*
RewriteRule ^(.*)$ web/$1 [L]
@haifahrul
haifahrul / index.php
Last active April 9, 2020 16:18
Yii2 Basic Web for Hosting - Add code below into your root projects
<?php
file_put_contents('.htaccess', <<<END
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/.*
RewriteRule ^(.*)$ web/$1 [L]
@haifahrul
haifahrul / postgres_fdw.sql
Created August 5, 2020 04:03 — forked from sathed/postgres_fdw.sql
postgres_fdw example
/***** "Remote" server first *****/
-- Note: Unless the object you are trying to gain access to is in the same DATABASE, it's a remote datebase. Even if it's
-- on the same node!
-- 1. create the role and assign it a password. Note: CREATE USER is an alias for CREATE ROLE. Either one is fine
CREATE ROLE new_user WITH PASSWORD 'somepassword';
-- 2. Grant the required permissions. This grants select, insert, update, and delete on all tables in the public schema.
-- I also gave execute to all functions in the public schema as well.
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO new_user;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO new_user;
@haifahrul
haifahrul / gpg_fix.txt
Created July 15, 2021 17:46 — forked from cezaraugusto/gpg_fix.txt
fixing `gpg failed to sign data` error on macOS
For troubleshooting, two things to first try:
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working
If that all looks all right, one next thing to try:
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry
If after that install and you re-try git commit and still get the "failed to sign the data" error:
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung
@haifahrul
haifahrul / options-echarts.js
Last active October 11, 2022 13:52
Apache Echarts
https://echarts.apache.org/examples/en/editor.html?c=area-stack&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcs0ArllgDRobDBaQgGrrpgBOEA5uziwQOQRgcAW14UmsEMADOAqNAIAzItADGkGLAAUkqWQkBDFvqG7YAE2BC9LHGr0yAXjgCUySuJUwpYCdIAaCL5SANoADAC6ANzuTJ7Q3kEAmoE6wQCMUTHocQlxgtBgAMoQTgDqEGZgABaBjjgAdHk4BcVOYZni2V4-TS0lOAASOBxVPoh1jTD5Rf3pHZ05PgBuEDgA7q045ZU14_31K-ub7dGdsLg-AB6BoaedF7AAnjfRWbAQClo6AQA8sL0zMoVaqwABkoKCAQA1LAbGp6tc_gDNttqq5GGdYNdELc3gBfWA4LBSHDvT7afywGFwsD1NbAmowgCssAAfIhDht-qiqui3uhsbBOSiGbAALT_KbNQFbBl3cQEokktyYrGBGkI8WSgrSkU7WAAelgACYqbAABz1Jnyph4lBvD5faTJJFSvpOIYjMB81XPRDW_GE4mkjFnP2w2y054S5H9T3sUZatLGm3oO1vGxgIgsODBS56R7zNNiJgKYAsIT6MCCHhfQzGKSueCslX3HA-XAKMawXi8VPnduwr2BXv9x3aesmepmKv6ACS0DMOGx8BxPsxne7vDSTIApH3-UOE1vQgezgajYrg2S60YpzOwPPF8uEKutA_9ABxIwgGrg8yzt--i_u0AD89QkmwOAhBk4EfuBuDQOwIISmkzjruIF5MJuI7mnuZ6dFh6BsMeI47vu_ZXsqoZtl2I5MqEFGHiRiaILwp6URm7bZnAAAGAAkSAgJOUjTrO9RgMAAAywAqPouCFKwEBIZo_BmGKc4ACK8M4BKaIJwl3qJ0DGDgeLOD8UjCXA3iPLg8AAEQAnwfY6LIMAEPoABGUg0EQgiRGYEBWVg-iPAQXlYLJADWkT0jsBChCAlyRJuBCCZueKRCxYDpUgO