Skip to content

Instantly share code, notes, and snippets.

@fhssn1
fhssn1 / gist:34097d52e32d0b21ef8c26e9faf8220d
Created July 31, 2016 22:23
Process timestamps in zsh history
paste -d' ' <(cat ~/.zsh_history | grep '^: ' | cut -b3-12 | xargs -I{} date -d @{} +'%Y-%m-%d %H:%M:%S') <(cat ~/.zsh_history | cut -b16-) > ~/.zsh_history_processed
@fhssn1
fhssn1 / glm_kazmath.diff
Created March 29, 2014 04:17
Some examples of equivalence of OpenGL math libraries glm (C++) and kazmath (C)
--- p6.cpp 2014-03-28 22:55:37.000000000 -0500
+++ p6.c 2014-03-28 23:02:28.000000000 -0500
@@ -7,9 +7,8 @@
#define PNG_DEBUG 3
#include <png.h>
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-#include <glm/gtc/type_ptr.hpp>
+#include <kazmath/kazmath.h>
@fhssn1
fhssn1 / capture print of a library function
Created March 20, 2014 19:44
Capture output (print or stdout) of a library function (or some command that you don't want to mess with) to a file
import sys
stdout = sys.stdout
with open('outfile.log','w') as sys.stdout:
library_function_that_prints()
sys.stdout = stdout