Skip to content

Instantly share code, notes, and snippets.

View applejag's full-sized avatar
🌴
Vacation

kalle (jag) applejag

🌴
Vacation
View GitHub Profile
@SavageCore
SavageCore / 1-readme.md
Last active April 17, 2025 15:00 — forked from cdleveille/Install⁄Update Xone
Install or update xone driver for Steam Deck (desktop shortcut and bash script)

Enjoying this script? Consider buying me a beer/coffee!

ko-fi

First time setting up your Deck? You may enjoy my setup guide. It'll get you started on Emulation.

Improvements

Main changes at initial release versus cdleveille's original script:

  • Added zenity for a basic "GUI"
@taylorza
taylorza / GO-Fillslice.md
Last active January 28, 2025 11:37
Golang - Fill slice/array with a pattern

Filling an array or slice with a repeated pattern

Looking for an efficient pure GO approach to copy repeating patterns into a slice, for a toy project, I ran a few tests and discovered a neat approach to significantly improve performance. For the toy project, I am using this to fill a background buffer with a specific RGB color pattern, so improving this performance significantly improved my acheivable framerate.

All the test were run with a buffer of 73437 bytes, allocated as follows

var bigSlice = make([]byte, 73437, 73437)

Fill the slice with the value 65 by looping through each element and setting the value

@allquixotic
allquixotic / README.md
Last active January 5, 2021 06:33
High Quality Pitch Shifting for Spotify on Windows with WSL2

The goal of this exercise is to get pitch shifting (changing the pitch of music up or down) working with Spotify on Windows 10 using WSL2. Technically this solution is really not dependent on WSL2 at all, but it does require you to have a Linux system running somewhere, whether virtual or physical, with extremely low latency and high throughput networking available to your Windows box.

For this solution, the actual sound playback will be occurring on your Windows PC using your soundcard, but there are other components of the solution that do some audio processing. I'll explain each.

Requirements

  1. A Spotify Premium account
  2. Windows build supporting WSL2; as of December 2019 that'd be the Insider Preview Slow or Fast Ring. This can also be done with Linux in VirtualBox, VMware, or Hyper-V, but I've not tested it.
  3. (Windows PulseAudio From Source method only) A recent Fedora-based distribution of Linux
  4. A modern distribution of Linux that can run a recent Rust toolchain; e.g. Debian Testing, l
@cho2
cho2 / virtualbox-silverblue.md
Last active June 10, 2023 00:13
Virtualbox on Team Silverblue
  • Install virtualbox repo

    cd /etc/yum.repos.d/
    wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
    
  • Edit virtualbox repo

    nano /etc/yum.repos.d/virtualbox.repo
    
@uarun
uarun / 01_IncreaseReplicationFactor.md
Last active November 21, 2024 10:32
Increase replication factor for __consumer_offsets Kafka topic

Increasing replication factor for a topic

  1. Create a custom reassignment plan (see attached file inc-replication-factor.json). In this case we are going from replication factor of 1 to 3.

  2. Run Kafka partition reassignment script:

    kafka-reassign-partitions --zookeeper $ZOOKEEPER_CONNECT \
        --reassignment-json-file /home/liquidnt/inc-replication-factor.json  \
        --execute
    
  3. Verify if the assignment was successful

@ufologist
ufologist / jquery-sanitize-html.html
Last active March 26, 2023 00:07 — forked from kaznum/gist:3810258
sanitize HTML with jQuery prevent Application from XSS attacks
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Sanitize HTML with jQuery</title>
</head>
<body>
<h1>Sanitize HTML with jQuery</h1>
<h2>HTML Code</h2>
@wojteklu
wojteklu / clean_code.md
Last active April 18, 2025 12:16
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@devhawk
devhawk / colorconsole.fs
Created August 4, 2016 17:19
F# Color Console Functions
open System
// helper function to set the console collor and automatically set it back when disposed
let consoleColor (fc : ConsoleColor) =
let current = Console.ForegroundColor
Console.ForegroundColor <- fc
{ new IDisposable with
member x.Dispose() = Console.ForegroundColor <- current }
// printf statements that allow user to specify output color
@martijnvermaat
martijnvermaat / nixos.md
Last active February 16, 2025 00:09
Installation of NixOS with encrypted root
@alessonforposterity
alessonforposterity / drgn.txt
Created April 12, 2015 04:43
Abandon all hope, ye who enter here
This file has been truncated, but you can view the full file.
//Dr. Seuss once wrote, "IF." He meant, "If you give a fuck, maybe,
//JUST MAYBE, you can change this shitty world in some small way for
//the better." I might've been an writer of children's books someday,
//but instead, I decided to make this. So in lieu of The Lorax,
//let's call this The Dragon, and have my word be, "DON'T." As in,
//"Don't do something stupid like this the way I did, you jackass."
//But the truth is humans are very stubborn creatures. You probably
//won't listen to my advice and, chances are, neither will I.
//This is just an excerpt of the source code for DRAGON: A Game About