Skip to content

Instantly share code, notes, and snippets.

@manzaloros
manzaloros / switch-arrays.js
Created August 3, 2021 12:17
Switching two arrays around
// If you have a function working on two arrays:
const compareArrays = (nums1, nums2) => {
...
}
// And you need the larger or smaller array to be in a certain position,
// you can do:
const compareArrays = (nums1, nums2) => {
// invoke function making smaller array first in the order:
if (nums1.length > nums2.length) return compareArrays(nums2, nums1);
@manzaloros
manzaloros / time-complexity.md
Last active October 25, 2022 16:47
Time Complexity Cheat Sheet

Top Down Recursive DP:

Non-memoized:

dp(n) => O((number of recursive calls) ^ (number of inputs))

  • recursive calls is how many times backtrack(...) is called recursively

Fibonacci:

         f(4)
 / \ 
@manzaloros
manzaloros / convert_cue_to_chd.sh
Created November 22, 2023 04:35
Convert .cue files in current directory to chd
#!/bin/bash
# Loop over all files in the current directory with a ".cue" extension
for file in *.cue; do
# Invoke chdman createcd with input and output options
chdman createcd -i "${file%.*}.cue" -o "${file%.*}.chd"
done
@manzaloros
manzaloros / mini-pc.md
Last active February 8, 2024 06:00
Mini PC, windows / Linux dual boot

Machine

Beelink Ser7

What doesn't work

Ser7

  • Machine USB A port -> USB 2 Hub -> all 2.4g dongles
    • This will greatly increase the effective range of wireless devices, allowing true usage in a home theater environment.

Windows

  • Some games using Anti Cheat will freeze the entire PC after 4-5 minutes. This seems to be a problem with the Ser5 BIOS, I've seen it on multiple machines. However, booting the games on Linux rather than Windows seems to fix the issue