Skip to content

Instantly share code, notes, and snippets.

View justbuchanan's full-sized avatar

Justin Buchanan justbuchanan

View GitHub Profile
@justbuchanan
justbuchanan / readme.md
Last active March 1, 2021 17:21
Show icons for open programs in i3's status bar. See a demo here: http://gfycat.com/AfraidAmusingCoyote
/*
This is a simple program for the MBED intended to determine what happens if a signal for a thread is
set before the corresponding wait is called. It behaves as expected, so the bug I'm tracking down is somewhere else...
*/
#include <mbed.h>
#include <rtos.h>
#include <cmsis_os.h>
void thread(const void* arg) {
@justbuchanan
justbuchanan / keybase.md
Created May 22, 2016 01:31
Keybase GitHub proof

Keybase proof

I hereby claim:

  • I am justbuchanan on github.
  • I am justbuchanan (https://keybase.io/justbuchanan) on keybase.
  • I have a public key ASD1L3Wi4J_PeKhF5_YV_X1V1B9Em2Sepm6HRtob8TqFRwo

To claim this, I am signing this object:

#!/usr/bin/env python2
#
# This script builds a ball-placement SSL Referee message for the yellow team
# and repeatedly broadcasts it. Usage:
# ./send_ssl_placement_cmd.py <x coord> <y coord>
#
# Install protobuf:
# pip2 install protobuf
#
# Compile protobuf files (this creates referee_pb2.py):
@justbuchanan
justbuchanan / main.cpp
Created July 24, 2016 17:29
Move semantics vs pass by reference on heap in c++
#include <iostream>
#include <vector>
#include <memory>
using namespace std;
struct MyObject {
std::vector<char> v;
char addr;
char port;
@justbuchanan
justbuchanan / .gitignore
Last active October 4, 2016 15:50
cpp-channel test
main
cpp-channel
@justbuchanan
justbuchanan / cudnn-PKGBUILD
Created October 16, 2016 01:51
Arch Linux PKGBUILD for cudnn 5.1.5 for cuda 8.0
# Modified version of the "cudnn" PKGBUILD on the AUR
# Original Author: Benjamin Chrétien <chretien dot b +aur at gmail dot com>
# Modified by Justin Buchanan <justbuchanan at gmail dot com> on 10/15/2016 to use latest version from nvidia
pkgname=cudnn
pkgver=5.1.5
pkgrel=1
pkgdesc="NVIDIA CUDA Deep Neural Network library"
arch=('x86_64')
url="https://developer.nvidia.com/cuDNN"
license=('proprietary')
@justbuchanan
justbuchanan / fix_cuda_compilation.patch
Last active October 17, 2016 03:48
Arch PKGBUILD for tensorflow with cuda 8.0 and cudnn 5.1.5 support
diff --git a/third_party/gpus/crosstool/CROSSTOOL.tpl b/third_party/gpus/crosstool/CROSSTOOL.tpl
index a367aa8..02cac9e 100644
--- a/third_party/gpus/crosstool/CROSSTOOL.tpl
+++ b/third_party/gpus/crosstool/CROSSTOOL.tpl
@@ -54,6 +54,9 @@ toolchain {
# Use "-std=c++11" for nvcc. For consistency, force both the host compiler
# and the device compiler to use "-std=c++11".
cxx_flag: "-std=c++11"
+ cxx_flag: "-D_MWAITXINTRIN_H_INCLUDED"
+ cxx_flag: "-D_FORCE_INLINES"
@justbuchanan
justbuchanan / i3style2xresources.py
Last active February 22, 2021 01:18
Convert i3-style themes to xresources format
#!/usr/bin/env python3
import yaml
import sys
from collections import OrderedDict
"""
This script converts i3-style themes into xresources format.
i3-style can be found here: https://github.com/acrisci/i3-style.
#!/usr/bin/env python3
## Volume script for i3blocks
#
# This script uses playerctl to update whenever the current song changes, rather
# than polling at a fixed interval.
#
# Dependencies:
# * python-gobject - system package
# * playerctl - system package