Skip to content

Instantly share code, notes, and snippets.

View snshn's full-sized avatar
☀️
shiny

Sunshine snshn

☀️
shiny
View GitHub Profile
@snshn
snshn / ubuntu-disable-screen-dimming.sh
Created June 24, 2024 12:52
Disable screen dimming in Gnome (Ubuntu)
gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 100
@snshn
snshn / rock.roll
Last active March 4, 2024 05:29
Rockabilly/Psychobilly/Rock'n'Roll bands and songs
Brutally Frank
The Razorbacks
Lee Rocker
The Paladins
Three Blue Teardrops
13 Cats
Swing Cats
The Head Cat
The Octanes
Kat Men
@snshn
snshn / git-coommit-stats.sh
Created April 19, 2022 00:59
See who committed to the repo (and how much)
git shortlog -s -n --all --no-merges
@snshn
snshn / Recipe-chocolate-cashew-milk.txt
Last active June 11, 2020 00:35
[recipe] Chocolate cashew milk
750ml cashew milk
2.5 tbsp cacao powder
0.5 tsp vanilla
2 tbsp xylitol
[optional]: 1 tsp of cornstarch or potato starch (to add thickness)
blend
@snshn
snshn / Recipe-cashew-milk.txt
Created June 6, 2020 03:55
[recipe] Cashew Milk
750ml water
1 cup whole organic raw cashews
put in blender and mix until there're no cunks
// <script>
class myXMLHttpRequest extends XMLHttpRequest {
constructor() {
super();
this._open = this.open;
this.open = (method, target) => {
// TODO replace file: with http/https: here
console.warn(target);
var base = "https://gist.github.com/snshn/a3f09016986abb04da16b80382f6adc5";
return this._open(method, new URL(target, base));
@snshn
snshn / audiosplit.sh
Last active November 28, 2019 02:46
Split album into individual tracks using cuesheet
shnsplit -o flac -t "%p - %a - %n - %t" -f *.cue *.flac
@snshn
snshn / mockXMLHttpRequest.js
Created September 20, 2018 04:53
mock XMLHttpRequest class
(function(w){
if ('NativeXMLHttpRequest' in w) return;
// Preserve the native XMLHttpRequest class
w.NativeXMLHttpRequest = w.XMLHttpRequest;
class XMLHttpRequestEventTarget extends EventTarget {
constructor() {
super();
@snshn
snshn / en-de-ru.csv
Last active June 20, 2021 07:26
Learning natural languages using CSV
EN DE RU
yes ja да
no nein нет
not nicht не
in in в
I ich я
you dir Вы
you dich тебя
in the im в
@snshn
snshn / hex-string-encode-decode.js
Created August 10, 2017 16:18
Kind of like btoa/atob, but doesn't trip on Unicode.
/**
* Encode a UTF-16 string as a string of hexadecimal letters
*/
function encodeIntoHex (string) {
var hex;
var hexString = "";
for (var i = 0, ilen = string.length; i < ilen; i++) {
hex = string.charCodeAt(i).toString(16);
hexString += ("000" + hex).slice(-4);