Skip to content

Instantly share code, notes, and snippets.

#!/bin/cat
# Useful GCC Debugging Things
# List optimizations enabled/disabled by O2
gcc -O2 -Q --help=opt
# List all automatically-defined symbols
gcc -E -dM - < /dev/null
# List all symbols defined by stdio.h
// Useful snippets for debugging floating-point calculations in c/c++
//
#include <fenv.h>
// Make fpu signal FPE on a NaN being generated by an expression
feenableexcept(FE_INVALID);
// Others
#!/bin/sh
# MEncoder nonsense
# MJPEG video input, and I stupidly rotated the camera while taking the movie.
# Not sure how to make transcode do JPEG decoding without amplifying noise.
# Thus: MEncoder
# Need forceidx because mjpeg isn't seekable in the typical fashion
# Clip off 4.4 seconds from beginning, then rotate it 90 degrees CCW and expand
# it to 640x640 (to account for rotation).
# Makefile for bulk mjpeg processing from my camera
OPTIONS = -vf $(FILTERS) $(MORE) -of avi -ovc xvid -xvidencopts bitrate=-500000
OPT_SOUND = -oac twolame
OPT_NOSOUND = -nosound
FILTERS = $(OPT_NOROTATE)
OPT_RRIGHT = rotate=1,pp=ac/al
OPT_RLEFT = rotate=2,pp=ac/al
OPT_NOROTATE = pp=ac/al
# To mark packages as auto-installed on debianish
# List packages that are installed and are not essential and are not marked auto
aptitude search '~i!~E!~M' > a
aptitude markauto <pkgs...>
aptitude unmarkauto <pkgs...>
@novas0x2a
novas0x2a / exiftool-tricks
Created March 2, 2011 23:12
Various exiftool things.
# Create EXIF GPS data from XMP GPS data
exiftool "-gps:all<all" "-gpsdatestamp<gpsdatetime" "-gpstimestamp<gpsdatetime" ...
# Clear bad XMP:GPS entries (... don't use if you have any images that are actually on the date line)
exiftool -r -GPSLongitude= -GPSLatitude= -if '$GPSLongitude == 0' ...
@novas0x2a
novas0x2a / gist:5052340
Created February 27, 2013 22:17
How to make sauce.
1. Get good tomatoes- the usual plastic ones won't do. I usually get heirlooms,
if I can. Look for ones that are kinda squishy, but not actually squished. If
they're too hard, they were probably picked too early and won't be sweet
enough.
2. Prep tomatoes.
1. Place each tomato on cutting board. Press down on tomato, and roll it
around cutting board. You're trying to damage the internal walls to get
them to release juice, without rupturing the skin (same thing you'd do
to an orange when making fresh OJ). Romas can take a lot of squeezing,
heirlooms usually can't.
@novas0x2a
novas0x2a / fuck_target_blank.js
Last active December 14, 2015 23:49
Auth Switcher
// ==UserScript==
// @name GMail Auth-Switch In Same Tab
// @namespace http://fluffypenguin.org
// @version 0.1
// @description This makes sure that the gmail auth switcher doesn't open a new tab.
// @match http://mail.google.com/*
// @match https://mail.google.com/*
// @copyright Mike Lundy <userscripts@fluffypenguin.org>
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
hm. calculating whether a human could jump to escape is KE = PE*m
KE = (momentum^2)/(2*human-mass) = (1/2)mv^2
PE = (G * planet-mass) / distance-from-center
I weigh ~77kg
my jump-height is 50cm
I derive my jump velocity from:
v^2 = 2*g*h
Human Qinggong Flowing Monk 2
Lawful Neutral
Str 15 Dex 14 Con 12 Wis 14 Int 10 Cha 8
Initiative +4
16hp (1d8+2+6)
Fort +4 Reflex +5 Will +5
AC 18 (15) Flat Footed 16 (13) Touch 17 (15)
BAB +1 CMB +3 (+5 on Trip) CMD 15 (17 vs. Trip)
Flurry: +2/+2 Unarmed Strike 1d6+2 x2