Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
@wuriyanto48
wuriyanto48 / README.md
Created August 12, 2025 01:31
Nextjs Avoid: Referenceerror: document is not defined

This error is relatively undetectable because when the page loads, it appears as if nothing is happening. However, when you open Developer Tools, you'll see that it actually returns a 500 Internal Server Error.

Usually caused by accessing documents in SSR code.

// NextJs SSR Code: for example
const { referrer } = document;

.....
const element = document.getElementById('my-element');
@wuriyanto48
wuriyanto48 / cicd.sh
Created August 6, 2025 09:22
CICD Template
#!/bin/bash
set -e
function checkout_code() {
echo "📥 [Checkout] Mengambil source code dari repository..."
sleep 1
}
function install_dependencies() {
@wuriyanto48
wuriyanto48 / README.md
Created August 6, 2025 07:02
Install Pandoc Linux
@wuriyanto48
wuriyanto48 / README.md
Created July 5, 2025 02:52
generate SSL with Lets Encrypt

SSL yang digunakan saat ini adalah Self Signed SSL gratis dari Lets Encrypt.

Langkah-langkah untuk men-generate Self Signed SSL.

Install Dependency yang diperlukan.

sudo apt update
sudo apt install certbot python3-certbot-nginx -y
@wuriyanto48
wuriyanto48 / README.md
Created July 1, 2025 02:20
How to set Telegram Webhook

Set Webhook with specific URL

POST https://api.telegram.org/bot1xxxxxxx:AAGxxxxxxxxxxxxxxxxxxxxxxxxxxxx/setWebhook?url=https://api.mycompamy.co/telegram/webhook/111

Check Webhook info

GET https://api.telegram.org/bot1xxxxxxx:AAGxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getWebhookInfo

Install NVIDIA Docker

# add repo
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# Update & install
sudo apt update
@wuriyanto48
wuriyanto48 / README.md
Created February 7, 2025 10:30
nc command in Windows

nc command Unix

nc -vz 192.0.1.1 -Port 3306

Test-NetConnection command Windows

Test-NetConnection -ComputerName 192.0.1.1 -Port 3306
@wuriyanto48
wuriyanto48 / README.md
Created January 7, 2025 11:04
Google Drive API with googleapis Nodejs

Install googleapis

npm i googleapis
@wuriyanto48
wuriyanto48 / setup.md
Last active November 14, 2024 06:05
Create Mock Server using Prism

Install Prism

npm install -g @stoplight/prism-cli

Create Mockup Json File using OpenApi spec

{
    "openapi": "3.0.0",
    "info": {
@wuriyanto48
wuriyanto48 / main.go
Last active November 4, 2024 10:20
image compression Golang
package main
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"image"
"image/jpeg"
_ "image/png"