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
@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"
@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);
@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) {
@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
@mjblay
mjblay / waitForKeyElements.js
Last active October 18, 2023 18:34 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content. Forked for use without JQuery.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
//--- Page-specific function to do what we want when the node is found.
function commentCallbackFunction (element) {
element.text ("This comment changed by waitForKeyElements().");
let gulp = require('gulp'),
replace = require('gulp-batch-replace'),
filesExist = require('files-exist');
gulp.task('bt4', () =>
{
let diff = {
'@media (min-width: $screen-xs-min) and (max-width: $screen-sm-max)': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, xs))',
'@media (min-width: $screen-xs) and (max-width: ($screen-md-min - 1))': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, md)-1)',
@steven2358
steven2358 / ffmpeg.md
Last active April 21, 2025 02:17
FFmpeg cheat sheet
@jschr
jschr / parseYouTubeUrl.js
Last active November 23, 2024 16:30
Parse YouTube URLs
import UrlPattern from 'url-pattern';
import qs from 'query-string';
// Returns YouTube Player API options from a YouTube URL.
// ie. { playlistId }
// { videoId, start, end }
// { query }
export default function parseYouTubeUrl(url) {
const [domain, querystring] = url.split('?');
const options = {};
@james2doyle
james2doyle / docker.fish
Last active September 29, 2023 13:27
Docker abbreviations for Fish shell
# usage: if read_confirm ...
function read_confirm
while true
read -l -p "Do you want to continue? [y/N] " confirm
switch $confirm
case Y y
return 0
case '' N n
return 1
end
@barkink
barkink / noauth-samba.conf
Created November 24, 2017 10:30
Samba No Auth
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as