Skip to content

Instantly share code, notes, and snippets.


Dan dantheman213

View GitHub Profile
dantheman213 / average-geolocation.js
Created Aug 23, 2020 — forked from tlhunter/average-geolocation.js
Calculate the center/average of multiple GeoLocation coordinates
View average-geolocation.js
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
* @url
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
dantheman213 / exponential_backoff.go
Last active Aug 11, 2020
Golang exponential back off simple example
View exponential_backoff.go
package main
import "fmt"
import "time"
import "math"
var exponentialBackoffCeilingSecs int64 = 14400 // 4 hours
func main() {
fmt.Println("Hello World")
Update nodejs to latest version:
sudo npm install -g n
sudo n latest
Update npm to latest version:
sudo npm install -g npm
Do what @runcible suggested
hash -d npm
echo "username ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
dantheman213 /
Last active Feb 23, 2021
ffmpeg cheatsheet

ffmpeg cheatsheet

Extract video at 30 seconds in and the duration with be 5 seconds

ffmpeg -ss 00:00:30 -i orginalfile -t 00:00:05 -vcodec copy -acodec copy newfile

Add a watermark logo to the bottom right of the video offset by 30 x 30 from corner

dantheman213 / bst.go
Created Apr 21, 2020
Golang binary tree
View bst.go
package main
import "fmt"
type Node struct {
Left, Right *Node
Value int64
type BinarySearchTree struct {
dantheman213 /
Created Apr 21, 2020
Detect all the commercial breaks points in a given TV show video file
ffmpeg -i "file.mp4" -vf "blackdetect=d=1:pix_th=0.00" -an -f null - 2>&1 | grep blackdetect
dantheman213 /
Created Apr 16, 2020
Generate an ISO using a docker container
OUTPUT_DIR=/mnt/c/Users/danie/Desktop/output \
docker run --rm -w /iso -v $INPUT_FILES_WITHIN_DIR:/iso -v $OUTPUT_DIR:/output genisoimage -v -J -V $ISO_LABEL -o /output/$OUTPUT_FILE_NAME .
dantheman213 / readme.txt
Created Mar 22, 2020
recommended video settings for best streaming
View readme.txt
1080p and below
Container = MP4
Video = h.264
Audio = AC3 / ACC
Container = MP4
Video = h.265
Audio AC3
dantheman213 / hyperv_on.ps1
Created Mar 14, 2020
Enable Hyper-V on Windows 10
View hyperv_on.ps1
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All