Skip to content

Instantly share code, notes, and snippets.

View nicholastay's full-sized avatar

Nicholas Tay nicholastay

View GitHub Profile
@nicholastay
nicholastay / via-iris-rev-4-nick.json
Last active August 14, 2021 15:14
VIA setup for my iris keeb - still experimenting and messing around, would be cool to see how this evolves (already has a few times!)
{
"name": "Iris Rev. 4",
"vendorProductId": 3406840406,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"MT(MOD_LALT,KC_ESC)",
"KC_1",
"KC_2",
"KC_3",
@nicholastay
nicholastay / .emacs
Last active November 16, 2021 13:01
WIP emacs (tested on windows for now + to put in dotfiles)
(setq inhibit-startup-screen t)
(menu-bar-mode 0)
(tool-bar-mode 0)
(scroll-bar-mode 0)
(setq ido-enable-prefix t)
(ido-mode 1)
;; Line numbers + its colour
;;(set-face-foreground 'line-number-current-line "#FFFF00")
@nicholastay
nicholastay / setup.md
Last active December 31, 2021 02:52
Fedora install notes

Fedora setup

Done with Fedora 35 i3 spin on X230 laptop. Kind of a build log.

Initial setup (Anaconda)

BTRFS with subvolumes, using Custom. Encryption with LUKS2 enabled.

  • /
  • /home
@nicholastay
nicholastay / copr-spec.user.js
Last active December 1, 2021 13:10
Copr RPM Spec Quickview
// ==UserScript==
// @name Copr RPM Spec Quickview
// @namespace nick@windblume
// @match https://copr.fedorainfracloud.org/coprs/*/*/
// @grant none
// @version 0.1.0
// @author Nicholas Tay <[email protected]>
// @description Quickly jump to the spec file for COPR packages (on the project's package page)
// @homepage https://gist.github.com/nicholastay/7a8d7883bb7e30ac36da344746b6126a
// @license Zlib
@nicholastay
nicholastay / Program.asm
Created December 2, 2021 08:17
A Program
segment .text
global _start
_start:
mov rax, 60
mov rdi, 0
syscall
@nicholastay
nicholastay / aoc2021.js
Last active December 23, 2021 13:52
Advent of Code 2021 for fun in JS
// AoC 2021 for fun in JS (real implementation in rust on my git repo)
// Probably not going to do this past first few days
// -- Day 1 --
// Part 1
input.split('\n').map(Number).map((x, i, arr) => x > arr[i-1]).filter(x => x).length
// Part 2
input.split('\n').map(Number).map((x, i, arr) => arr[i+1] + arr[i-1] > arr[i-1] + arr[i-2]).filter(x => x).length
// -- Day 2 --
@nicholastay
nicholastay / c-format.sh
Last active May 23, 2022 11:13
astyle settings for me
astyle \
--mode=c \
--style=linux \
--indent=tab=4 \
--break-one-line-headers \
--keep-one-line-blocks \
--align-pointer=name \
--pad-comma \
--pad-header \
--unpad-paren \
@nicholastay
nicholastay / mirror.sh
Created April 19, 2022 03:31
yum-based system (rocky) set mirrors to fixed ones - useful for firewalled env
sed -i 's/^mirrorlist=/#mirrorlist=/g;s/^#baseurl.*\/\(.*\)\/$basearch.*/baseurl=https:\/\/mirror.aarnet.edu.au\/$contentdir\/$releasever\/\1\/$basearch\/os\/\nbaseurl=https:\/\/rockylinux.mirror.digitalpacific.com.au\/$releasever\/\1\/$basearch\/os\//g' /etc/yum.repos.d/Rocky-*.repo
@nicholastay
nicholastay / ..porth-stuff.md
Last active May 23, 2022 11:11
misc porth stuff test

porth-stuff

Just some random programs in porth because I saw Tsoding's videos/stream and I thought it looked cool.

Licence: MIT

@nicholastay
nicholastay / genshinlog.sh
Last active October 12, 2023 10:39
Simple Genshin Wish URL getter in bash (tested with git bash) + Honkai Star Rail Warp getter
# Place in `.bashrc` or similar for easy access!
# (This script was made because I didn't really trust running a random .ps1 script every time, and it's hard
# for me to audit those. This is much simpler and doesn't involve executing a script off a URL.)
#
# Last updated for 4.1 updated wish page
genshinlog() {
GENSHIN_INSTALL_DIR="/c/Games/Genshin Impact"
LATEST_CACHE="$(find "$GENSHIN_INSTALL_DIR"'/Genshin Impact game/GenshinImpact_Data/webCaches' -maxdepth 1 -type d -name '2.*' | sort | tail -1)"
grep -aoP 'https://hk4e-api-os.hoyoverse.com/.+?/getGachaLog.+?&game_biz=hk4e_global' "$LATEST_CACHE/Cache/Cache_Data/data_2" | tail -1 | tee /dev/tty | clip