Skip to content

Instantly share code, notes, and snippets.

@andybest
andybest / gist:d3019ff1742012dbcf42
Created July 6, 2014 18:34
Adding Ruby-like times method to Swift integers
extension Int {
func times(it: () -> ()) {
for i in 0..self {
it()
}
}
}
// Use like so:
@andybest
andybest / Git_tips.md
Last active August 29, 2015 14:19
Git tips

Always assume a file in the repo is unchanged (like putting an already committed file into .gitignore)

git update-index --assume-unchanged <file>

Undo the above

git update-index --no-assume-unchanged <file>

List files that are assumed unchanged

(lldb) p o
(Triangle) $R0 = {
...
material = {
surfaceColor = (x = 0, y = 1, z = 0)
}
...
}
(lldb) p o.material.surfaceColor
(Vector3) $R1 = (x = 0, y = 0, z = 0)
@andybest
andybest / cue_export.py
Created September 4, 2022 17:16
Export Rekordbox cue sheets to a human readable form
#!/usr/bin/env python3
import argparse
import re
import sys
def read_cues(input_path, output_path):
if output_path is not None:
sys.stdout = open(output_path, 'w')