Skip to content

Instantly share code, notes, and snippets.

View spookyuser's full-sized avatar
🌎
reading and writing

spookyuser

🌎
reading and writing
View GitHub Profile
@ghostbear
ghostbear / Spotify - How to reduce and limit the cache size (Windows - Mac).md
Last active March 21, 2025 19:56
[Spotify] How to limit the cache size (Windows/Mac OS)

Credit to MadHatter

WINDOWS

Use your text editor of choice or if you don't have one use Windows Notepad
Opening with Notepad may or may not result in a fancy mess

  1. Close Spotify
  2. Open File Explorer and paste the following into the address bar %appdata%/Spotify¤
  3. Open the file named prefs with your text editor
  4. Change the numeric value following storage.size= . If storage.size= doesn't exist add it manually to the end of the file and assign numeric value. This value represents megabytes. One gigabyte equals 1024 megabytes. In the end, it should look something like this storage.size=1024
  5. Save the file
@simonwhatley
simonwhatley / GoogleDistance.gs
Last active October 3, 2024 17:11
Get the distance between 2 addresses in Google Sheets using Google Maps
/**
* Get the distance between 2 different addresses.
* @param {string} origin_address The origin/start address as string Eg. "102 Petty France, London, SW1H 9AJ".
* @param {string} destination_address The destination/end address as string Eg. "10 Whitechapel High Street, London, E1 8QS".
* @param {string} travel_mode The mode of travel as string. Default: DRIVING. Options: BICYCLING, TRANSIT, WALKING.
* @param {string} return_type The return type as string. Default: MILES. Options: KILOMETERS, MINUTES, HOURS, STEPS.
* @return the distance between 2 different addresses.
* @customfunction
*/
function GOOGLEDISTANCE(origin_address,destination_address,travel_mode,return_type) {
@impankratov
impankratov / handlebars.js
Last active September 8, 2021 15:59
Example of registering custom handlebars helpers (+ handlebars-form-helpers) with webpack
// Import Handlebars runtime lib
const Handlebars = require('handlebars/runtime');
const register = require('handlebars-form-helpers').register;
const { registerHandlebarHelpers } = require('../../some/other/place');
// Register extra helpers
register(Handlebars);
registerHandlebarHelpers(Handlebars);
@sergiobd
sergiobd / BatchConvertVideos.ps1
Last active June 12, 2024 13:40
Batch convert videos using ffmpeg and powershell
# Script to convert a list of files using ffmpeg and powershell. This example converts to .ogv files (theora/vorbis as video/audio codecs)
# Please note that, if you havent done so, you should set the execution policy of powershell in order to be able to run this script.
# The easiest way to run this script without messing to much with execution policies is to set it for a single powershell session:
# powershell.exe -ExecutionPolicy Unrestricted
# Check: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
$filenames = "1","2", "3", "4", "5","6","7"
$filepath = "C:\Users\Oculus\Documents\Videos\Menu\"
$extension = ".mp4"
@mwfogleman
mwfogleman / gtd_basb_templates.org
Last active September 17, 2024 22:12
GTD/BASB Templates for Emacs and Org-Mode
@nickcernis
nickcernis / readme.md
Last active April 27, 2025 12:51
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@gagarine
gagarine / fish_install.md
Last active April 29, 2025 09:11
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@stek29
stek29 / idevicerestore.sh
Created January 12, 2019 12:22
idevicerestore on linux (Debian-based)
sudo apt update
# sudo apt upgrade
sudo apt install -y libcurl4-openssl-dev libplist-dev libzip-dev openssl libssl-dev libusb-1.0-0-dev libreadline-dev build-essential git make automake libtool pkg-config
git clone https://github.com/libimobiledevice/libirecovery
git clone https://github.com/libimobiledevice/idevicerestore
git clone https://github.com/libimobiledevice/usbmuxd
git clone https://github.com/libimobiledevice/libimobiledevice
git clone https://github.com/libimobiledevice/libusbmuxd
git clone https://github.com/libimobiledevice/libplist
@reznor244
reznor244 / playlist-stitch.sh
Last active January 30, 2024 15:06
playlist-stitch: Downloads all files in an m3u playlist and stitches them together into a single .mpg file
#!/bin/bash
declare -a req=("wget" "basename" "rm" "cat" "echo")
for cmd in "${req[@]}"
do
command -v $cmd >/dev/null 2>&1 || { echo "Required command not found: $cmd"; exit 1; }
done
[ $1 ] || { echo "Usage: $0 file1 [file2] [file3...]"; }
@zzpmaster
zzpmaster / formatBytes.dart
Last active April 21, 2025 17:26
convert bytes to kb mb in dart
static String formatBytes(int bytes, int decimals) {
if (bytes <= 0) return "0 B";
const suffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var i = (log(bytes) / log(1024)).floor();
return ((bytes / pow(1024, i)).toStringAsFixed(decimals)) +
' ' +
suffixes[i];
}