Skip to content

Instantly share code, notes, and snippets.


Christopher Woodall cwoodall

Block or report user

Report or block cwoodall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View trello_reading_list.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# credit to olibre from stackoverflow (
File_png="${1?:Usage: $0 file.png}"
if [[ ! -s "$File_png" ]]; then
echo >&2 "The first argument ($File_png)"
echo >&2 "must be a file having a size greater than zero"
( set -x ; ls -s "$File_png" )
cwoodall /
Created Dec 24, 2016
A little script for generating compressed gifs using ffmpeg from a video file (webm, or mp4)
cwoodall /
Created Dec 20, 2016
My New Bash Prompt with Git Status
green() {
printf "\e[32m${1}\e[00m"
light_red() {
printf "\e[91m${1}\e[00m"
cwoodall / gist:5c1db855d896d4476111f273f2f631ea
Created Jun 24, 2016
Intersting C++ embedded process runner
View gist:5c1db855d896d4476111f273f2f631ea
#include <iostream>
#include <stdint.h>
using namespace std;
template <uint32_t f>
bool ProcessTask(void);
template <uint32_t f>
uint32_t RunProcess(uint32_t start) {
cwoodall / gist:ecfe6b5c6cf31ffcfa9a
Created Aug 4, 2015
A SerialTransporter using multiprocessing. For use in future projects.
View gist:ecfe6b5c6cf31ffcfa9a
import serial
from multiprocessing import Queue, Process, Event, Value
import logging
class SerialTransporter(object):
def __init__(self, port, baud=115200, timeout=1):
self.port = port
self.baud = baud
import numpy as np
import scipy
from scipy import signal
import pylab as pl
if __name__ == "__main__":
N = 1024*8
A = 2**14
An = 400
phase = np.pi/5
View tesseract_test.cpp
/* Results for image
This book was chiefly intended for English (and American)
readers. Those points are emphasised which in the judgment of
the author required emphasis for such readers. It may be worth
while, therefore, in preparing a French translation, to indicate
quite frankly and in a few words one or two of those aspects of
the situation arising out of the Treaty of Versailles, which are of
special significance for France.
cwoodall / gist:7952754
Last active Dec 31, 2015
Extract data from data_file which is a "binary string". Returns it in the format (Data[31 downto 8], Data[7 downto 0]) which is technically data, ADC channel... Created this after talking to Dean DeCarli.
View gist:7952754
import struct
from itertools import izip_longest
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx... From stackoverflow"
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
# Extract data from data_file which is a "binary string". Returns it in the format (Data[31 downto 8], Data[7 downto 0])
# which is technically data, ADC channel
cwoodall /
Created Jun 28, 2012
Unsigned Fixed Point... With a little bit of work can work for signed, will convert to signed for large numbers if you try to convert to float or string... Not much interest in fixing, because it works for my little 16 bit numbers (and masks down to your
class UFixedPoint(object):
def __init__(self, num, m, n):
self.mask = 2**(m + n) - 1
self.k = (1 << (n - 1))
self.m = m
self.n = n
temp = int(num * 2**self.n)
self.value = temp & self.mask
You can’t perform that action at this time.