Skip to content

Instantly share code, notes, and snippets.

View dirumahrafif's full-sized avatar
🏠
Working from home

Programming di Rumahrafif dirumahrafif

🏠
Working from home
View GitHub Profile
# Mengimpor kelas-kelas yang diperlukan dari direktori core
from core.base import Base # Kelas dasar untuk aplikasi OpenGL
from core.openGLUtils import OpenGLUtils # Utilitas untuk mengelola program shader
from core.attribute import Attribute # Mengelola data atribut vertex
from core.uniform import Uniform # Mengelola data uniform shader
from OpenGL.GL import * # Mengimpor semua fungsi inti OpenGL
# Mendefinisikan kelas Test yang merupakan turunan dari kelas Base
class Test(Base):
# Metode inisialisasi, dipanggil sekali saat program dimulai
# --- Impor Modul ---
from core.base import Base
from core.openGLUtils import OpenGLUtils
from core.attribute import Attribute
from core.uniform import Uniform # Mengimpor kelas Uniform yang sudah dibuat.
from OpenGL.GL import *
class Test(Base):
def initialize(self):
print("Initializing program...")
# Mengimpor kelas-kelas yang diperlukan dari direktori 'core' dan library PyOpenGL
from core.base import Base
from core.openGLUtils import OpenGLUtils
from core.attribute import Attribute
from OpenGL.GL import *
# --- Definisi Kelas Utama ---
# Membuat kelas 'Test' yang mewarisi fungsionalitas dari kelas 'Base' (kemungkinan besar untuk membuat window dan menjalankan loop utama)
class Test(Base):
# --- Metode Inisialisasi ---
from core.base import Base
from core.openGLUtils import OpenGLUtils
from core.attribute import Attribute
from OpenGL.GL import *
class Test(Base):
def initialize(self):
print("init")
# Vertex Shader
vsCode = """
@dirumahrafif
dirumahrafif / 3_buat-hexagonal.py
Last active November 28, 2025 05:44
Membuat Bentuk
from core.base import Base
from core.openGLUtils import OpenGLUtils
from core.attribute import Attribute
from OpenGL.GL import *
class Test(Base):
def initialize(self):
print("init...")
# position merujuk dari referensi associateVariable
@dirumahrafif
dirumahrafif / 2_buat-titik.py
Created November 21, 2025 01:54
Membuat titik dengan GLSL
from core.base import Base
from core.openGLUtils import OpenGLUtils
from OpenGL.GL import *
class Test(Base):
def initialize(self):
print("init...")
vsCode = """
void main()
{
@dirumahrafif
dirumahrafif / base.py
Created November 19, 2025 22:07
Package dasar untuk membuat window di python dengan pygame
import pygame
import sys
from core.input import Input
class Base(object):
def __init__ (self, screenSize=[512,512]):
pygame.init()
displayFlags = pygame.DOUBLEBUF | pygame.OPENGL
pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLEBUFFERS, 1)
pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLESAMPLES, 4)
@dirumahrafif
dirumahrafif / readme.md
Created October 1, 2025 10:09
Konfigurasi Nginx Untuk Mengarahkan Domain

Install nginx

sudo apt install nginx

cek firewall

sudo ufw app list

buka port 80

@dirumahrafif
dirumahrafif / readme.md
Last active September 10, 2025 16:42
Jalankan NextJS di VPS

Jalankan NextJs di VPS

  • Di dalam project nextJs
npm install #instal dependencies
npm run build
npm start # coba di control + c akan tertutup
  • supaya bisa jalan terus install pm atau process manager
@dirumahrafif
dirumahrafif / globals.css
Created September 6, 2025 06:16
Boiler Plate File CSS Belajar NextJS
/* General Body Styles */
body {
margin: 0;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
Arial, sans-serif;
line-height: 1.6;
background-color: #f4f4f4;
color: #333;
display: flex;