Skip to content

Instantly share code, notes, and snippets.

@pstoll
pstoll / video_noob_guide.md
Created January 2, 2026 16:07 — forked from arch1t3cht/video_noob_guide.md
What you NEED to know before touching a video file

What you NEED to Know Before Touching a Video File

Hanging out in subtitling and video re-editing communities, I see my fair share of novice video editors and video encoders, and see plenty of them make the classic beginner mistakes when it comes to working with videos. A man can only read "Use Handbrake to convert your mkv to an mp4 :)" so many times before losing it, so I am writing this article to channel the resulting psychic damage into something productive.

If you are new to working with videos (or, let's face it, even if you aren't), please read through this guide to avoid making mistakes that can cost you lots of computing power, storage space, or video quality.

@pstoll
pstoll / gs-tiller-group-cat-report-macros.js
Last active May 1, 2022 20:03
GoogleSheet Group Category Reports Macros
/** @OnlyCurrentDoc */
/** If you use Tiller & Category Rollup reports, this macro will create the groups to hide/collapse each level of report
* code from https://stackoverflow.com/questions/67784454/group-and-collapse-rows-in-google-apps-script
* relevant docs:
* https://community.tillerhq.com/t/docs-category-rollup-report/121
* https://spreadsheet.dev/reading-from-writing-to-range-in-google-sheets-using-apps-script
*
*/
@pstoll
pstoll / CMakeLists.txt
Created February 3, 2019 17:49
hex sum 1.0.4 source setup.
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(primesieve "7.0" REQUIRED )
#if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
# set(CMAKE_C_COMPILER "emcc")
# set(CMAKE_CXX_COMPILER "emcc")
#endif ()
@pstoll
pstoll / CMakeLists.txt
Last active November 17, 2023 23:42
Some prime number research, providing the ability to select precision and see the tradeoffs on speed. Do everything to make the computation fast. Yes, I feel dirty about the sighandler stuff.
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(primesieve "7.0" REQUIRED )
#if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
# set(CMAKE_C_COMPILER "emcc")
# set(CMAKE_CXX_COMPILER "emcc")
#endif ()
$ python ./test-seqs.py
timing 5 iterations with 1000 items:
first 5 ids: ['5aalphabetR84', '2aalphabet3aY', 'BmalphabetACg', 'JMalphabetunQ', 'Gqalphabet7le']
func dedup_orig: 0.00107002258301
func dedup_a1: 0.000247001647949
func dedup_a2: 0.000427961349487
timing 5 iterations with 10000 items:
first 5 ids: ['UPalphabetGuF', 'gqalphabet1rI', 'DGalphabetxbx', 'cHalphabetOYB', 'JYalphabetzW2']
func dedup_orig: 0.0133740901947
func dedup_a1: 0.00292015075684
# /usr/bin/env python
# Author: Perry A. Stoll <perry at pstoll dot com>
# Date: June 2017
# Copyright Perry Stoll
#
# Generate the first N fibonnaci numbers.
#
# Note this is quite different from generating the Nth fibonnaci
# numbers in terms of storage and laying out the computation
#include <assert.h>
#include <inttypes.h>
#include <iostream>
#include <iterator>
#include <vector>
#include <chrono>
$ openssl s_client -showcerts -connect verizon.com:443
CONNECTED(00000003)
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=Santa Monica/O=EdgeCast Networks, Inc./CN=*.can.transactcdn.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
{
"battery": {
"temp_stats": {
"max": 29.469999313354492,
"90th": 28.979999542236328,
"10th": 26.260000228881836,
"50th": 27.1299991607666,
"min": 25.84000015258789
},
"cells": {
@pstoll
pstoll / run.txt
Last active November 26, 2015 01:22
Sample showing the power of slices and letting callers specify the output array for NumPy like ufuncs
primesieve-python pstoll$ python testnumpy.py
straight into array: [ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71]
offset by 10: [ 0 0 0 0 0 0 0 0 0 0 2 3 5 7 11 13 17 19 23 29]
strided by 2: [ 2 0 3 0 5 0 7 0 11 0 13 0 17 0 19 0 23 0 29 0]