Skip to content

Instantly share code, notes, and snippets.

View refeed's full-sized avatar

Rafid Aslam refeed

View GitHub Profile
@refeed
refeed / jam_bantu_simaster_kkn.js
Last active January 18, 2024 14:13
hitung jam bantu simaster
// Guide:
// 1. Pergi ke simaster > kkn > rpp
// 2. Buka salah satu rpp proker sehingga terlihat proker bantu
// 3. Tekan F12 untuk memunculkan console, lalu paste script di bawah ini
// - Jika script tidak berjalan, bisa ketik: `allow pasting` terlebih dahulu (terkhusus untuk chrome)
(function payingkeyen() {
// change this when the ui is updated
const TABLE_JAM_BANTU = $("#subcontent-element > div:nth-child(8) > div.panel-body > div > table");
@refeed
refeed / zulip-archive proposal: Jinja2 templating as configuration.md
Last active July 8, 2022 10:53
zulip-archive proposal: Jinja2 templating as configuration

Zulip-archive proposal - Use jinja2 templating as config instead of telling the user to edit the internal code

The problem

  • Currently the way of how zulip-archive's users to change the looks of their website is to fork the project then change the internal library, especially lib/website.py
  • I think it would be better to give the responsibility of handling the rendering part to a more reliable and mature library (such as Jinja2) rather than managing the implementation ourselves as zulip-archive becoming a more complex project.

Proposed solution

  • Use templating library like jinja2 to handle how the page wi
# Tugas 2 Rafid Aslam
from queue import Queue
BLOCKED_NODES_SET = {
'A1', 'A2', 'A4', 'A5', 'A6',
'B1', 'B3', 'B4', 'B5', 'B6',
'D1', 'D2', 'D4', 'D6',
'E1', 'E2', 'E4', 'E6',
'F1', 'F4', 'F6',
# Tugas 1 Rafid Aslam
from queue import Queue
BLOCKED_NODES_SET = {
'A2', 'A3', 'A4', 'A5',
'B2', 'B4',
'C4', 'C6',
'D4',
'E2', 'E4', 'E5',
@refeed
refeed / BST.py
Last active April 15, 2021 13:21
Binary Search Tree
import math
class Node:
def __init__(self, angka=None):
self.angka = angka
self.left = None
self.right = None
class BST:
def __init__(self):
@refeed
refeed / minheap.py
Created April 8, 2021 10:04
Minheap
class MinHeap:
def __init__(self):
self._list = []
self._cursor_idx = 0 # Points to the latest index
def insert(self, value):
self._list.append(value)
parent_idx = self._get_parent_idx(self._cursor_idx)
current_idx = self._cursor_idx
@refeed
refeed / linkedlist.py
Last active March 18, 2021 08:07
LinkedList dengan Python
class Node:
def __init__(self, nama_lengkap, nama_panggilan, niu):
self.nama_lengkap = nama_lengkap
self.nama_panggilan = nama_panggilan
self.niu = niu
self.next: Node = None
class LinkedList:
def __init__(self):
@refeed
refeed / infix_posfix.py
Last active March 8, 2021 14:02
Implementasi Infix Posfix Python
# Class yang berfungsi sebagai ADT stack
class Stack:
def __init__(self):
self._stack = []
self._top = -1
def push(self, element):
self._top += 1
self._stack.insert(self._top, element)
@refeed
refeed / plane_state_gamaforce.py
Created November 7, 2020 07:44
PlaneState Gamaforce
class PlaneState:
def __init__(self, pitch=0.0, roll=0.0, yaw=0.0):
self.pitch = pitch
self.roll = roll
self.yaw = yaw
@property
def pitch(self):
return self.__pitch
@refeed
refeed / jarak_3d.py
Last active November 8, 2020 02:55
Jarak 3D gamaforce
from math import cos, sqrt, radians
INPUT_COORDINATE_MSG = 'Masukkan latitude longitude dan tinggi dipisahkan dengan spasi:\n'
def get_distance_any_dimensions(coordinate_1, coordinate_2):
"""
Menghitung jarak absolut dari dua koordinat dimensi apapun menggunakan
Euclidean distance.