Skip to content

Instantly share code, notes, and snippets.

View jeremywrnr's full-sized avatar
🍎

jeremywrnr

🍎
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jeremywrnr on github.
  • I am jwrnr (https://keybase.io/jwrnr) on keybase.
  • I have a public key ASAx6T8uKxs1QPj5QBwbv0vrIMXO1nQH54vB3hviDoXArwo

To claim this, I am signing this object:

@jeremywrnr
jeremywrnr / setup.sh
Created October 1, 2016 01:24
start controlling gpio on rpi w/ python
#!/bin/bash
# python gpio setup from:
# http://raspberry.io/projects/view/reading-and-writing-from-gpio-ports-from-python/
# Install Python development tools
sudo apt-get update
sudo apt-get install python-dev python-pip
sudo pip install --upgrade distribute
sudo pip install ipython
@jeremywrnr
jeremywrnr / scholar_rename.rb
Created September 20, 2016 02:44
renames a pdf file to author-year-title.pdf
#!/usr/bin/env ruby
# scholar-rename
# prereq: pdftotext installation
# renames a pdf file to author-year-title.pdf
# confirms with user before moving
# warning: accurate ~ 50% of time
system("pdftotext -q #{ARGV.first} temptext")
@jeremywrnr
jeremywrnr / serial.rb
Created September 8, 2016 17:43
Pipe serial monitor output to OSX keyboard
# using the SerialPort gem, rout serial input to OSX keyboard
require 'serialport'
require 'accessibility/keyboard'
include Accessibility::Keyboard
# params for serial port, may be different for you
port = '/dev/cu.usbmodem1421'
SerialPort.open(port) do |sp|
# configure port
%% begin 'cv.tex'
%------------------------------------------------------------------ Doc settings
\documentclass[letterpaper,11pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedright
\raggedbottom
\usepackage{ulem}
@jeremywrnr
jeremywrnr / basic-parallel.rb
Created February 11, 2016 18:26
basic parallelism in ruby
group = 0..8
threads = []
group.each do |member|
threads << Thread.new do
# DO MULTITHREADING HERE
# puts member
end
@jeremywrnr
jeremywrnr / tv.rb
Last active February 11, 2016 18:27
Colors in your shell
#!/usr/bin/env ruby
# add colors
class String
def colorize(bg)
"\e[0;0;#{bg}m#{self}\e[0;0m"
end
end
@jeremywrnr
jeremywrnr / status.sh
Last active February 11, 2016 18:28
Use find and sed to show status of all git repos (under cwd)
#!/bin/bash
# status - a git tool by jeremy warner
# cycle through subfolders, run git status, cleanup
# check if verbose
for arg; do if [[ $arg == "-v" ]]; then verbose="true"; fi; done
@jeremywrnr
jeremywrnr / erlangB.pl
Created December 8, 2014 20:56
erlang B implementation, calculating max users given acceptable GOS
#/usr/bin/env perl -w
# by jeremy warner, f14
use strict;
# determine number of channels to test
die "enter \# channels, then sectors\n" unless @ARGV == 2;
my ($chan, $sect) = @ARGV;
# program constants
@jeremywrnr
jeremywrnr / latex-plot.tex
Last active August 29, 2015 14:08
all of my favorite tex things
% required package for plotting
\usepackage{pgfplots}
% required package for plotting
\begin{center}
\begin{tikzpicture}
\begin{axis}[
title={Question 2},
xlabel={Nodes},
ylabel={Voltage (V)},