Skip to content

Instantly share code, notes, and snippets.

@dontfreakout
dontfreakout / tggl-track-ceil.js
Created June 27, 2023 14:32 — forked from Gaspadlo/tggl-track-ceil.js
Toggle Track week overview logs ceiling rounder - rounds dangling seconds to full minutes (JS bookmarklet script)
javascript: window.sleepFn = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
window.processingLog = false;
window.processedLogs = 0;
clearInterval(window.roundingInterval);
window.visibleTogglEvents = Array.from(document.querySelectorAll(".rbc-event"));
window.visibleTogglEventsCount = window.visibleTogglEvents.length;
window.roundingInterval = setInterval(async () => {
if (window.processingLog) {
return;
}
@dontfreakout
dontfreakout / create-vod-hls.sh
Created July 6, 2021 13:53 — forked from maitrungduc1410/create-vod-hls.sh
Bash scripts to create VOD HLS stream with ffmpeg (Extended version)
#!/usr/bin/env bash
LC_NUMERIC="en_US.UTF-8"
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
@dontfreakout
dontfreakout / htpasswd.py
Created February 2, 2016 12:26 — forked from guerrerocarlos/htpasswd.py
Python script for generating htaccess passwords
#!/usr/bin/python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from optparse import OptionParser
# We need a crypt module, but Windows doesn't have one by default. Try to find
@dontfreakout
dontfreakout / sh_env_var_opts.sh
Created January 22, 2016 10:51 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
// Takes [count] of items and the [partition] (array of percentages) to
// distribute against. Returns an array of integers that sums to [count]:
// an integer composition weighted by the partition.
//
// We don't use the Bresenham algorithm because it doesn't provide the best
// results for low values of [count].
function DISTRIBUTE(count, partition) {
// Custom function in Apps Script takes a 2D array. We're only interested in
// the first row.
partition = partition[0];