Skip to content

Instantly share code, notes, and snippets.

View henrytriplette's full-sized avatar
🦦
Unfortunately I may be slow to respond.

Henry Triplette henrytriplette

🦦
Unfortunately I may be slow to respond.
View GitHub Profile
@jboner
jboner / latency.txt
Last active March 4, 2025 16:45
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@aras-p
aras-p / preprocessor_fun.h
Last active March 4, 2025 20:23
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@midascodebreaker
midascodebreaker / laravel-per-project-installation.md
Last active March 15, 2022 10:09
Laravel Homestead per Project Installation on Windows 10
Prerequisite:
  • Php7
  • Composer
  • Gulp
  • Npm
  • Vagrant
  • Virtual Box
  • Laravel Installer
@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active November 14, 2024 03:32
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@henrytriplette
henrytriplette / Cmd_Powershell_Bat_Shippets.md
Last active July 9, 2019 10:06
Cmd and Powershell Snippets

Rename all files inside folder in lowercase. Recursive. - Cmd

for /f "Tokens=*" %f in ('cmd /c "echo %cd%& dir /l/b/ad/s"') do (for /f "Tokens=*" %g in ('dir /l/b/a-d "%f"') do (rename "%f"\"%g" "%g"))

:: Rename all directories to lowecase. Recursive - Cmd

for /F %a in ('dir /L /B') do ren %a %a

Count number of lines inside a file

@henrytriplette
henrytriplette / RaspberryPi Useful commands.md
Last active August 29, 2019 02:13
RaspberryPi Useful commands

Disable screen blanking in X-Windows on Raspbian

xset s off         # don't activate screensaver
xset -dpms         # disable DPMS (Energy Star) features.
xset s noblank     # don't blank the video device

Disk space, memory and cpu

df -h: Shows information about the available disk space.
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active March 4, 2025 21:07
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@PeterDekkers
PeterDekkers / polyend-play-convert.py
Last active August 26, 2024 12:25
Simple macOS script to convert AIFF and WAV files to 44.1kHz 16bit mono PCM. Ideal for use with Polyend Play.
#! /usr/bin/python3
"""
Simple macOS script to recursively convert AIFF and WAV files to 44.1kHz 16bit mono PCM.
Ideal for use with Polyend Play.
Only files that are not already in the right format will be converted.
Requires Python 3.