Skip to content

Instantly share code, notes, and snippets.

View codenoid's full-sized avatar

codenoid

  • Wonogiri, Jawa Tengah
  • 19:58 (UTC +07:00)
View GitHub Profile
@codenoid
codenoid / wilayah.json
Last active February 14, 2024 18:03
Data Wilayah 38 Provinsi (Pemekaran Papua) (Lvl Prov-Kelurahan)
This file has been truncated, but you can view the full file.
{
"provinsi": {"11": "ACEH", "12": "SUMATERA UTARA", "13": "SUMATERA BARAT", "14": "RIAU", "15": "JAMBI", "16": "SUMATERA SELATAN", "17": "BENGKULU", "18": "LAMPUNG", "19": "KEPULAUAN BANGKA BELITUNG", "21": "KEPULAUAN RIAU", "31": "DKI JAKARTA", "32": "JAWA BARAT", "33": "JAWA TENGAH", "34": "DAERAH ISTIMEWA YOGYAKARTA", "35": "JAWA TIMUR", "36": "BANTEN", "51": "BALI", "52": "NUSA TENGGARA BARAT", "53": "NUSA TENGGARA TIMUR", "61": "KALIMANTAN BARAT", "92": "PAPUA BARAT", "62": "KALIMANTAN TENGAH", "63": "KALIMANTAN SELATAN", "64": "KALIMANTAN TIMUR", "65": "KALIMANTAN UTARA", "71": "SULAWESI UTARA", "72": "SULAWESI TENGAH", "73": "SULAWESI SELATAN", "74": "SULAWESI TENGGARA", "75": "GORONTALO", "76": "SULAWESI BARAT", "81": "MALUKU", "82": "MALUKU UTARA", "91": "PAPUA", "93": "PAPUA SELATAN", "94": "PAPUA TENGAH", "95": "PAPUA PEGUNUNGAN", "96": "PAPUA BARAT DAYA"},
@codenoid
codenoid / curl.sh
Last active December 25, 2023 09:09
s.id Shortlink Generator Public API
curl 'https://s.id/api/public/link/shorten' -H 'User-Agent: Chrome/62.0 (BSD x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: https://s.id' -H 'Connection: keep-alive' -H 'Referer: https://s.id/' --data 'url=https%3A%2F%2Fne.com'
@codenoid
codenoid / docker-compose.yml
Last active November 6, 2023 15:43
2023 Wordpress MySQL Docker Compose
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb:10.6.4-focal
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
restart: always
# codenoid
# https://gist.github.com/codenoid/4806365032bb4ed62f381d8a76ddb8e6
printf "Checking latest Go version...\n";
LATEST_GO_VERSION="$(curl --silent https://go.dev/VERSION?m=text | head -n 1)";
LATEST_GO_DOWNLOAD_URL="https://go.dev/dl/${LATEST_GO_VERSION}.linux-amd64.tar.gz"
printf "cd to home ($USER) directory \n"
cd $HOME
printf "Downloading ${LATEST_GO_DOWNLOAD_URL}\n\n";
@codenoid
codenoid / curl.sh
Last active September 22, 2022 20:31
Golang Upload -> Resize -> Return modified image
curl -F "file=@input.jpg" http://localhost:8080/upload --output result.jpg
@codenoid
codenoid / nginx.config
Created November 20, 2021 13:49
Wordpress + NGINX + Cloudflare SSL + Cloudflare config file
# WORDPRESS + NGINX + CLOUDFLARE SSL
# Make sure you already download cloudflare origin cert and place it wherever you want
# Set Cloudflare SSL Setting to FULL (instead of Flexible)
server {
listen 80;
listen 443;
root /var/www/site.com;
index index.php index.html index.htm;
package main
import (
"context"
"fmt"
"time"
"github.com/qiniu/qmgo"
"gopkg.in/mgo.v2/bson"
)
@codenoid
codenoid / first-answer.md
Last active May 13, 2021 22:38
palestine israel ownership

Hi!

Really quickly:

Jews and Palestinians lived there side by side in peace, before WWII.

This is not true. We have narratives showing as far back as 1885 that there were clashes between Arabs and Jews, they had always had sources of tension in the past (including under the Ottomans in the 1840s for example), and riots occurred in 1920, 1921, 1929, and an Arab Revolt occurred from 1936-1939, and frequent clashes between. There was not a lot of peace going around before WWII, though it was less violent (most would say) before WWI.

When the jews got immigrated to the land of the later state of isreal, who owned it?

@codenoid
codenoid / go-resource.md
Created May 6, 2021 16:37
Some resources that have helped me learn golang over the last 3 years.

Some resources that have helped me learn golang over the last 3 years. I taught myself golang, it was a lot of grinding initially but I went through with it because I really liked the simplicity yet ability to be bare metal.

Here are some resources that have helped me in my journey. Sharing them here in case anyone is looking for study materials. [Disclaimer: These are links/notes collected over 3 years and not necessarily in order of expertise, but I will try my best to order them starting from basic ones and moving to more advanced resources]

Firstly - https://golang.org/ and https://golang.org/doc/ .Learn straight from the gophers mouth.

https://www.udemy.com/share/1013gw/ - Todd Mcloeds Course which I completed. Lays a strong and solid foundation of the most important golang concepts. I hope hes been updating his course. Highly recommend.

Tip: I created a repo while following the course. Helped drill the concepts in. Feel free to use this or or make something similar as your learn.

cargo build --release
go build -trimpath
node index.js