Skip to content

Instantly share code, notes, and snippets.

View felix-kyun's full-sized avatar
✌️
¯\_(ツ)_/¯

Praise Jacob felix-kyun

✌️
¯\_(ツ)_/¯
  • 14:57 (UTC +05:30)
View GitHub Profile
@felix-kyun
felix-kyun / Makefile
Last active March 17, 2025 19:00
makefile template for c projects
# Makefile
CC := gcc
CFLAGS := -Wall -Wextra -Werror -pedantic
INCLUDE_DIR := include
SOURCE_DIR := src
BUILD_DIR := build
INCLUDES := -I$(INCLUDE_DIR)
LIBS := <include libs and lib path>
SOURCES := $(shell find $(SOURCE_DIR) -type f -name '*.c')
TARGET := <project name>
@felix-kyun
felix-kyun / factorial.js
Created January 14, 2025 17:58
js program to find factorials of larger numbers
const toInt = (str) => str - "0";
function factorial(num) {
num = trimLeadingZero(num);
if (num === "0" || num === "1") return "1";
return stringMultiply(num, factorial(stringSubtract(num, 1)));
}
function trimLeadingZero(num) {
@felix-kyun
felix-kyun / console.js
Created April 29, 2024 16:42
download view only pdf from google drive
let jspdf = document.createElement( "script" );
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName( "img" );
for ( let i in elements) {
let img = elements[i];
if (!/^blob:/.test(img.src)) {
continue ;
}
let canvasElement = document.createElement( 'canvas' );
@felix-kyun
felix-kyun / lcrypt.c
Last active August 6, 2023 16:52
lcrypt.lua ported to c, simple no nonsense super fast file encryption
/* INFO:
* made by Felix
* original source lcrypt.lua ->
* `https://gist.github.com/Felix-Kyun/5c9cb2eb5a40289825cb2705bd1f1654`
* @arg -> 0:@mode{e, d} 1:@file_name[i] 2:@file_name[o] 3:@pass
* example:",
* `$ lcrypt e file.txt encrypted_file.txt felix@crypt`",
* `$ lcrypt d encrypted_file.txt file.txt felix@crypt`",
* @mode <- only 'e' or 'd' meaning encrypt and decrypt respectivly",
* @pass has to be supplied with no space"};
@felix-kyun
felix-kyun / omz_setup.md
Created August 4, 2023 16:49
fast zsh setup with omz and p10k and some plugins

💻 Fast Copy Paste Command To Setup

install zsh git and wget/curl

zsh git curl 

install omz

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@felix-kyun
felix-kyun / nord_tty.sh
Created July 25, 2023 10:46
Nord Theme for TTY (vconsole)
# nord-tty
# format \\e]PXRRGGBB
# where X is terminal color
# RRGGBB is a hexcolor
echo -en \\e]P02E3440
echo -en \\e]P1BF616A
echo -en \\e]P2A3BE8C
echo -en \\e]P3EBCB8B
echo -en \\e]P481A1C1
@felix-kyun
felix-kyun / arch_install.md
Last active September 12, 2025 21:16
a simple guide to install arch on uefi with encrypted btrfs root with snapper and systemd-boot

Aim

  • btrfs root with snapper
  • luks encrytpion on root partition
  • systemd-boot
  • hyprland
  • zram + swap

Lets get Started Then

@felix-kyun
felix-kyun / swap_args.sh
Last active November 7, 2022 16:47
calculate kernel args for swap file on btrfs
# taken from https://superuser.com/questions/1581885/btrfs-luks-swapfile-how-to-hibernate-on-swapfile
wget "https://raw.githubusercontent.com/osandov/osandov-linux/61679ecd914d653bab14d0e752595e86b9f50513/scripts/btrfs_map_physical.c" &&
gcc -O2 -o btrfs_map_physical btrfs_map_physical.c &&
./btrfs_map_physical $1 | sed -n "2p" | awk "{print \$NF}" >/tmp/swap_physical_offset
SWAP_PHYSICAL_OFFSET=$(cat /tmp/swap_physical_offset)
SWAP_OFFSET=$(echo "${SWAP_PHYSICAL_OFFSET} / $(getconf PAGESIZE)" | bc)
SWAP_UUID=$(findmnt -no UUID -T $1)
@felix-kyun
felix-kyun / picom-template
Created October 31, 2022 19:54
pijulius picom template for xbps-src
# Template file for 'picom-pijulius'
pkgname=picom-pijulius
version=8
revision=2
wrksrc=picom
build_style=meson
configure_args="-Dwith_docs=true"
hostmakedepends="git pkg-config asciidoc"
makedepends="MesaLib-devel dbus-devel libconfig-devel libev-devel pcre-devel pixman-devel xcb-util-image-devel xcb-util-renderutil-devel libxdg-basedir-devel uthash"
depends="desktop-file-utils"
@felix-kyun
felix-kyun / arch-btrfs-mbr-bios-setup.md
Last active October 27, 2022 06:37
simple guide to install and setup arch on a bios/mbr machine with btrfs

Install

i've written this on obsidian so the format may be a bit weird on github

Pre Configure

  • set font
setfont ter-124n