Skip to content

Instantly share code, notes, and snippets.

View jdowner's full-sized avatar

Joshua Downer jdowner

View GitHub Profile
@jdowner
jdowner / Turret.cpp
Created January 5, 2012 01:52
A simple turret that tracks a target.
#include "Turret.h"
#include <cmath>
#include <algorithm>
#include <cassert>
namespace
{
const double TWOPI = 2.0 * M_PI;
}
@jdowner
jdowner / example.qml
Last active June 2, 2021 18:34
How to pass a Qml Component as a signal parameter.
import QtQuick 1.0
Rectangle {
height: 300
width: 400
color: "gray"
// This text element is for visual feedback when the signal fires
Text {
text: "(empty)"
@jdowner
jdowner / noise.cfg
Last active August 29, 2015 14:04 — forked from rsvp/noise.sh
ambient noise
duration='00:59:00'
noisetype='pinknoise'
progress='--no-show-progress'
noisetype="pinknoise"
band_center="1000"
band_width="499"
tremolo_speed="0.01"
tremolo_depth="43"
@jdowner
jdowner / index.html
Last active August 29, 2015 14:05
Javascript coroutine experiment
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>coroutine-traversal-example</title>
</head>
<script src="traversal.js"></script>
<body>
</body>
<script>
@jdowner
jdowner / example.html
Created August 13, 2014 10:58
Example of SVG interaction and transformation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>svg-example</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<style>
.bottom {
fill: blue;
stroke: blue;
@jdowner
jdowner / example.html
Last active August 29, 2015 14:05
Example of SVG event passthrough
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>svg-event-overlay</title>
<style>
.first {
fill: red;
}
@jdowner
jdowner / munkres-np-subtract.py
Last active August 29, 2015 14:06
Performance testing numpy subtract verses the interpreter
#!/usr/bin/python
import contextlib
import numpy
import time
@contextlib.contextmanager
def timer():
start = time.time()
yield
@jdowner
jdowner / vim-build.sh
Last active November 13, 2018 09:32
vim-build
#!/bin/bash
PREFIX=${HOME}/usr/local
VIMRUNTIMEDIR=${PREFIX}/share/vim/vim80/
./configure --with-features=huge \
--enable-multibyte \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib/python3.5/config \
--enable-cscope \
@jdowner
jdowner / HOWTO-bitlbee+hipchat.mkd
Last active August 29, 2015 14:11 — forked from taylor/HOWTO-bitlbee+hipchat.mkd
Configuring bitlbee + hipchat

Using bitlbee with HipChat

First time on bitlbee

  • register <username>

Initial setup

@jdowner
jdowner / immutable.py
Created December 12, 2014 14:19
immutable decorator
import functools
def make_immutable(obj):
"""Tries to create an immutable version of an object
Converts object into a nested structure of named tuples where possible.
Primative types (int, str, float, bool) are unchanged but lists and sets are
converted into tuples. Objects are converted into named tuples.
This is not a terribly sophisticated function and will work best with