Skip to content

Instantly share code, notes, and snippets.

View codenoid's full-sized avatar

Rubi codenoid

View GitHub Profile
@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
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"},
"kabupaten": {"11": {"01": "ACEH SELATAN", "02": "ACEH TENGGARA", "03": "ACEH TIMUR", "04": "ACEH TENGAH", "05": "ACEH BARAT", "06": "
@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.

# 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";
cargo build --release
go build -trimpath
node index.js
package main
import (
"fmt"
"net/http"
"runtime"
"time"
)
func main() {
@codenoid
codenoid / app.py
Last active April 23, 2020 02:59
Flask handle 404 with rickroll
@app.errorhandler(404)
def handle404(error):
html = "<center>"
html += "<br><br><br>"
html += '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?controls=0&autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
html += "<br>"
html += "nothing to do here :p"
html += "</center>"
return html