Skip to content

Instantly share code, notes, and snippets.

View nopeless's full-sized avatar

nopeless nopeless

  • 00:48 (UTC -06:00)
View GitHub Profile
#!/bin/bash
set +euo pipefail
LANG="C.UTF-8"
n() {
(($1 >= ${#A[@]})) && return
L=$(($1 + $2))
Q=$(($2 * 2))
V=${A[$1]}
@nopeless
nopeless / shortcuts.xml
Last active November 26, 2025 13:48
generated via an LLM (USE AT YOUR OWN RISK)
<?xml version="1.0" encoding="UTF-8" ?>
<NotepadPlus>
<!--
This shortcuts.xml file is configured to reflect many common Visual Studio Code keybindings.
- Some default Notepad++ shortcuts have been changed.
- Not all VS Code shortcuts can be mapped due to feature differences (e.g., integrated terminal, debugger).
- Multi-key shortcuts from VS Code (e.g., Ctrl+K Ctrl+C) cannot be mapped directly. A single-key alternative has been used where available.
-->
<InternalCommands>
<!-- General File Operations -->
const classes = new Set();
document.querySelectorAll('[class]').forEach(el => {
el.classList.forEach(cls => classes.add(cls));
});
const replacer = prefix => [...classes].find(c => c.startsWith(prefix));
const classRegex = /class\^=("[^"]+"|(?:\\.|[^\\\n\]])+)/g;
const cssProcessor = text => text.replace(classRegex, match => `class=${replacer(match[1])}`);
pathColor="\033[38;2;104;169;196m"
errColor="\033[38;2;255;60;60m"
sucColor="\033[38;2;152;82;173m"
resetColor="\033[m"
if ((EUID)); then
userColor="\033[38;2;201;116;173m"
userSymbol='$'
else

Caution

This is a technical guide and not for the faint of heart. You WILL run into issues while setting the system up. It is more of a proof of concept than a viable solution for the average user

End goal

Make dynmap available on exaroton

Requirements

  • a cheapo vps that can run 24/7 with an open ip address
@nopeless
nopeless / f-razer.ps1
Last active May 15, 2025 00:15
uninstall razer script because the uninstaller doesn't properly uninstall
Set-PSDebug -Strict
Set-StrictMode -Version Latest
$WarningPreference = "Inquire"
$ErrorActionPreference = "Stop"
$rp = Get-Process | ? { $_ -like "*razer*" }
if ($rp -and $rp.Count -gt 0) {
Write-Host "Potential Razer processes:"
@nopeless
nopeless / lua-build.ps1
Created October 10, 2023 19:26
Simple Lua build script for Windows using MSVC
<#
Instructions:
Clone/download Lua source code from https://www.lua.org
Run this script from the root of the source code directory
You may need to install Visual Studio build tools with MSVC compiler
#>
@nopeless
nopeless / async-string-splitter.md
Last active March 13, 2023 23:22
A challenge for myself

When splitting a large string, it is best to use a worker thread, microservice, or a lambda. However, if you are looking into event-loop based solutions, you have to leverage JavaScript's api for scheduling tasks.

Code:

const createAwaitTick = () => ({ then(fn) { setImmediate(fn) } });

async function *_charGenerator(str, batchSize) {
    let i = batchSize
    for (const c of str) {
@nopeless
nopeless / check-prime.ts
Last active March 3, 2025 02:03
static prime checking using typescript types
// Prime checking regex, which this code is based off of
// https://regex101.com/r/RIJkGF/1
type StringDivisible<n extends string, div extends string> = n extends `` ? true : n extends `${div}${infer r}` ? StringDivisible<r, div> : false;
type Substrings<n extends string, d extends string = ""> = n extends `${d}${infer r}` ? readonly [` ${d}`, ...Substrings<r, ` ${d}`>] : readonly [];
type StringFactors<n extends string> = Substrings<n> extends readonly [unknown, ...infer R extends readonly string[], unknown] ? R : never;
type StringIsPrime<n extends string, Factors extends readonly string[] = StringFactors<n>> = Factors extends readonly [infer s extends string, ...infer R extends readonly string[]] ? StringDivisible<n, s> extends true ? false : StringIsPrime<n, R> : true;
type RepeatStringByStringDigit<str extends string, d extends string> =