Skip to content

Instantly share code, notes, and snippets.

View grahamsaulnier's full-sized avatar

Graham Saulnier grahamsaulnier

  • Unity Technologies
  • Montreal, QC
View GitHub Profile
@ojame
ojame / delete.js
Created June 29, 2017 05:47
Delete all movies that haven't been 'downloaded' in Radarr. Mass/bulk deleting.
// Go to Radarr and click 'settings' => 'general'.
// Open the JavaScript Console in Google Chrome (View => Developer => Javascript Console)
// Past the following in. Hit enter and away you go.
const key = document.getElementsByClassName('x-api-key')[0].value;
if (!key) {
alert('Navigate to /settings/general and run again');
}
@iToto
iToto / convertMDToDocx.py
Created August 2, 2013 18:55
pandoc convert md to docx in folder
import os
import subprocess
for dirname, dirnames, filenames in os.walk('.'):
for filename in filenames:
if '.md' in filename:
print ("converting file: "+filename+" into: "+filename[:-3]+".docx")
subprocess.call("pandoc "+filename+" -f markdown -t docx -s -o "+filename[:-3]+".docx",stderr=subprocess.STDOUT,shell="true")
"""
combine.py
alternate between two audiofiles, beat by beat
By Paul Lamere, 2013-01-25
"""
import echonest.audio as audio
usage = """
@jboner
jboner / latency.txt
Last active December 14, 2025 16:19
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
@ehamberg
ehamberg / gist:1875967
Created February 21, 2012 11:23
C Pointer Declarations

C/C++ Pointer Declaration Syntax – It makes sense!

I never really liked the way pointers are declared in C/C++:

int *a, *b, *c; // a, b and c are pointers to int

The reason is that I am used to reading variable declarations as MyType myVar1, myVar2, myVar3; and I always read “int*” as the type “integer pointer”�. I therefore wanted the following

int* a, b, c; // a is a pointer to int, b and c are ints