Skip to content

Instantly share code, notes, and snippets.

View jahabrewer's full-sized avatar

Janzen Brewer-Krebs jahabrewer

  • Qualtrics
  • Seattle, WA
View GitHub Profile
@jahabrewer
jahabrewer / elidedlabel.cpp
Created May 30, 2019 15:35
Modified Qt ElidedLabel that shrinks to fit content (see https://stackoverflow.com/q/56365244/187359 )
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
@jahabrewer
jahabrewer / fftandplot.m
Created May 17, 2018 01:04
Loads an audio file and plots its waveform and FFT
## Adapted from https://www.mathworks.com/help/matlab/ref/fft.html
function retval = fftandplot (filename, tStart, tEnd)
Fs = audioinfo(filename).SampleRate;
X = audioread(filename);
# Convert to mono
X = X(:,1);
# Convert times to sample indexes
@jahabrewer
jahabrewer / tropico4.ahk
Created April 21, 2018 18:06
Tropico 4 autohotkey script
; Tropico 4 Betterizer - jahabrewer edition
;
; This is a modified version of an ahk script I found on steam. I've added the
; ability to set game speed directly with 1,2,3 and reversed the Q,E rotation to
; be what I expected. I got my feel for Q,E rotation from XCOM.
;
; I got really used to the control scheme of Rimworld, and I love Tropico 4.
; I stumbled across an AHK script written years ago, and decided to improve it.
; License: Public domain.
; Author: Kamerad ggppjj on Steam
@jahabrewer
jahabrewer / scantegrity.py
Created December 12, 2016 17:28
(poor, bad, not crypto safe, DO NOT USE) Scantegrity II prototype
import random
import csv
import sys
import hashlib
from Crypto.Hash import SHA256, HMAC
import binascii
salt = '2hiy2EMaM693EEpwGXqZssSd2yCOABYWCB'
pbkdf_rounds = 100000