Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / area-example-response.json
Last active February 19, 2020 09:36
Area Example Response
[
{
"_id" : "5e4b8bcf4a5980dc45b995c1",
"name" : "Jakarta",
"regional" : [
{
"village" : "GAMBIR",
"district" : "GAMBIR",
"city" : "JAKARTA PUSAT",
"province" : "DKI JAKARTA",
@haifahrul
haifahrul / GO - Air Makefile
Created February 3, 2020 09:10
Makefile for serve Air live reload for Go Apps
start:
echo 'YOUR_PASS_SUDO' | sudo -kS kill -9 `lsof -t -i:"$(SERVICES_GRPC_PORT)"` | godotenv go run main.go
serve:
air -c .air.conf
@haifahrul
haifahrul / GO - Config file for Air in TOML format
Last active February 3, 2020 09:08
Live reload for Go apps
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
# Working directory
# . or absolute path, please note that the directories following must be under root.
root = "."
tmp_dir = "tmp"
[build]
# Just plain old shell command. You could use `make` as well.
cmd = "make start -o ./tmp/main ."
@haifahrul
haifahrul / code.md
Created January 8, 2020 17:16 — forked from gopalindians/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI

@haifahrul
haifahrul / List of Library Useful for Golang.md
Last active November 15, 2019 04:03
List of Library Useful for Golang

List of Library Useful for Golang

  • protoc-go-inject-tag - This script injects custom tags to generated protobuf files, useful for things like validation struct tags.
  • go-proto-validators - Generate message validators from .proto annotations.
  • gogo/protobuf - Protocol Buffers for Go with Gadgets
  • protoc-gen-go/retag - A plugin for protoc-gen-go to reset struct tags.
  • protoc-gen-gotag - PGGT is a protoc plugin used to add/replace struct tags on generated protobuf messages

Implemented standard rule guide of Cross Programming Language. The proto will be using to anothers language such as NodeJS, Python, etc. So we don't recommended the library which is modifed the standard file *.proto,