Skip to content

Instantly share code, notes, and snippets.

View btmxh's full-sized avatar

btmxh

View GitHub Profile
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterable
from typing import cast, override, Protocol, Self
from random import choice, choices, random
from heapq import nsmallest, heapify, heappush, heappop
from math import sqrt
import csv
class Comparable(Protocol):
@btmxh
btmxh / rofi.conf
Created February 20, 2024 06:56
rofi config
configuration {
/* modes: "window,drun,run,ssh";*/
/* font: "mono 12";*/
/* location: 0;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
/* show-icons: false;*/
/* terminal: "rofi-sensible-terminal";*/
/* ssh-client: "ssh";*/
@btmxh
btmxh / raytracing-weekend.c
Created December 1, 2023 19:13
raytracing weekend thing implementation in plain C
// compile with (linux) gcc -std=c11 -Ofast -lcglm -lm -fopenmp raytracing-weekend.c
// dependencies: cglm (available on AUR), openmp (probably already installed on ur system)
#include <cglm/vec3.h>
#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
{
"contact": "",
"templates": [
{
"name": "akira",
"sources": [
"https://media.discordapp.net/attachments/1132280154010423397/1133098114601979905/Untitled130_20230724210636.png?width=80&height=40"
],
"x": 2895,
"y": 1191
@btmxh
btmxh / userscript.user.js
Last active April 3, 2022 04:19 — forked from gaudi99/userscript.user.js
template tool for r/place with hololive template
// ==UserScript==
// @name Hololive combo
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Spread the love
// @author oralekin
// @match https://hot-potato.reddit.com/embed*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
// ==/UserScript==
@btmxh
btmxh / userscript.user.js
Last active April 3, 2022 02:57 — forked from oralekin/userscript.user.js
osu! Logo Template for 2022 /r/place
// ==UserScript==
// @name osu! Logo template
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the canvas!
// @author oralekin, LittleEndu, ekgame
// @match https://hot-potato.reddit.com/embed*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
// ==/UserScript==
@btmxh
btmxh / boilerplate.cpp
Last active March 4, 2022 07:03
cpp boilerplate for IT class
#include <iostream>
//Bai cua nhom:
template<typename T>
inline T input(const char* help) {
T value;
std::cout << help; std::cin >> value;
return value;
}
package com.dah.scene3d.test;
import com.dah.scene3d.utils.BetterShader;
import com.dah.scene3d.utils.BetterShaderBuilder;
import com.dah.scene3d.utils.GLSLPlusProcessor;
import de.javagl.obj.Obj;
import de.javagl.obj.ObjReader;
import de.javagl.obj.ObjUtils;
import lengine.engine.Context;
import lengine.engine.mesh.Mesh;
@btmxh
btmxh / ChainCallback.java
Last active February 25, 2020 08:52
Chain Callbacks for LWJGL 3
package lightningstrike.glfw.chaincb;
import java.util.*;
import org.lwjgl.glfw.*;
import org.lwjgl.system.CallbackI;
public abstract class ChainCallback<CB extends CallbackI.V> extends LinkedList<CB> implements CallbackI.V {
@Override
public void callback(long args) {