Skip to content

Instantly share code, notes, and snippets.

View deadManAlive's full-sized avatar

rafky alfarrakhan deadManAlive

View GitHub Profile
@deadManAlive
deadManAlive / remove_bad_marks_siakng.js
Created April 8, 2025 04:38
Got those stinky read marks in your SIAKNG staining your transcript? worry not! run this on main/Academic/HistoryByTerm via console to hide those pesky marks!
(() => {
const rows = document.querySelectorAll("table tr.alt, table tr.x");
let i = 1;
for (k of rows) {
const data = k.querySelectorAll("td");
if (getComputedStyle(data[8]).color !== 'rgb(17, 17, 17)') {
k.hidden = 'true';
} else {
data[0].innerHTML = `${i}.`;
i += 1;
@deadManAlive
deadManAlive / how_to_build_FFMPEG.txt
Created December 5, 2023 16:09
Build portable FFMPEG with AV1 (libsvtav1/libdav1d) and/or VVC (libvvenc/libvvdec) for Windows with MinGW64 (MSYS2)
Prerequisites:
* MSYS2 with MinGW64 environment.
* build tools: `pacman -S mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-winpthreads-git `
AV1 supports
* libsvtav1 (encoder): `pacman -S mingw-w64-x86_64-svt-av1`
* libdav1d (decoder): `pacman -S mingw-w64-x86_64-dav1d`
VVC supports
* libvvenc (encoder):
@deadManAlive
deadManAlive / list.h
Created September 16, 2023 05:02
Compile time linked list in C++14
#pragma once
#include <type_traits>
#ifndef DEBUGM
namespace comptime {
namespace List {
#endif
// List variant for tail end.
struct Nothing {};
@deadManAlive
deadManAlive / ocaml-on-msys2.md
Last active March 2, 2025 14:53
Installing Ocaml (latest w/o opam) in Windows via MSYS2

Installing OCaml (latest w/o opam) in Windows via MSYS2

  1. Preparation: MSYS2 MinGW64, make sure git, make, diffutils, and gcc installed, e.g. with pacman -S git make diffutils mingw-w64-x86_64-gcc.
  2. git clone https://github.com/ocaml/ocaml.git.
  3. git submodule update --init.
  4. ./configure, then make, and then install with make install.

At this point ocaml, ocamlc, and ocamlopt is already installed on the MSYS2 MinGW64 environment, but you'll hit by error like "Unbound module Stdlib".

  1. Check standard_library location via ocamlc -config, should be /mingw64/lib/ocaml.
@deadManAlive
deadManAlive / b2hfunc.ts
Last active June 27, 2023 14:15
binary to decimal
const b2h: (string) => string = (bin: string) => bin.split("")
.reverse()
.reduce((p, c, i, a) => {
switch(i % 4 === 0) {
case true:
return p.concat(a.slice(i, i + 4).join(""));
default:
return p;
}
}, <string[]>[])
@deadManAlive
deadManAlive / double.ml
Created June 6, 2023 15:58
doubling rotate or something
(* input *)
let q = ['A'; 'B'; 'C'; 'D'; 'E'];;
let pos = 20;;
let rec list_print queue =
match queue with
| [] -> ()
| h :: t ->
Printf.printf "%c " h;
list_print t;;
@deadManAlive
deadManAlive / ftemphell.cpp
Created December 5, 2022 17:03
some experiment with functional and template to note
#include <iostream>
#include <vector>
#include <functional>
#include <ranges>
#include <string>
template <template<class> class I, class T>
requires std::ranges::output_range<I<T>, T> && std::convertible_to<T, double>
void foriter(I<T>& iterable, const std::function<void(T&)>& func)
{
@deadManAlive
deadManAlive / bitstring.cpp
Last active June 29, 2022 05:26
julia inspired bitstring function
#include <iostream>
#include <string>
#include <cmath>
#include <cassert>
using str = std::string;
static str itob(const unsigned int& num) {
str res = "";
@deadManAlive
deadManAlive / opfinder.user.js
Created June 1, 2022 09:24
get post's op user id
// ==UserScript==
// @name 9Gag OP Finder
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description 9gag op finder
// @author deadManAlive
// @match https://9gag.com/gag/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=9gag.com
// @grant none
// ==/UserScript==
@deadManAlive
deadManAlive / intparse.go
Created May 11, 2022 04:03
integer to list of integer
func iparse( n int) []int {
var res []int
var dec int
var par int
pwr := 1
for i := 0; dec <= n; i++ {
dec = pow(10, pwr) //pow(int, int) int func.
par = 10*(n % dec)/dec