Skip to content

Instantly share code, notes, and snippets.

Joshua Ryan Smith jrsmith3

Block or report user

Report or block jrsmith3

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
jrsmith3 / kink.ipynb
Created Apr 17, 2015
Analysis of kink in plot of photon energy flux vs. temperature for semiconductor
View kink.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:e3a0fd3175c2c68d1248

Keybase proof

I hereby claim:

  • I am jrsmith3 on github.
  • I am joshuarsmith ( on keybase.
  • I have a public key whose fingerprint is E0A0 7701 0330 22E5 29A9 3AC5 9A19 5912 200C 61F9

To claim this, I am signing this object:

jrsmith3 /
Created Dec 23, 2014
Adjust the default font size of your matplotlib figure
import matplotlib as mpl
mpl.rcParams["font.size"] = 10
The MIT License (MIT)
Copyright (c) 2014 Joshua Ryan Smith
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
jrsmith3 / pip_install_matplotlib
Created May 2, 2014
matplotlib instal issues
View pip_install_matplotlib
gamma:~ jrsmith3$ pip install matplotlib
Downloading/unpacking matplotlib
Downloading matplotlib-1.3.1.tar.gz (42.7MB): 42.7MB downloaded
Running (path:/private/var/folders/qs/jhzvfv7x41v8p_6y91p044ww0000gn/T/pip_build_jrsmith3/matplotlib/ egg_info for package matplotlib
Edit setup.cfg to change the build options
matplotlib: yes [1.3.1]
python: yes [2.7.6 (default, Apr 9 2014, 11:48:52) [GCC
jrsmith3 /
Created Apr 3, 2014
Convert specified pages from a PDF to png
This script was used to create the figures for from a PDF file containing some old CMU sample logs.
import PyPDF2
from wand.image import Image
import io
import os
jrsmith3 /
Created Mar 12, 2014
Converts every scribus document to a PDF in a specified directory.
Convert every .sla to a pdf in a specified directory.
This script can only be run from within [scribus](http://
import os
work_dir = #you have to explicitly tell scribus where your working directory is.
filenames = os.listdir(work_dir)
jrsmith3 /
Last active Aug 29, 2015
Split a monolithic git repo into several small ones
# -*- coding: utf-8 -*-
I used the following script to convert each subdirectory of work.git into its own git repo. The one exception was paper-2013.01.16_nea_collector which I did by hand using essentially the same method as below, except I skipped the part where I removed the tags. I used the procedure found at [1] and slightly modified it. I also used the solution in [2] to convert non-bare repos to bare. Note also that I first cloned work from its bare git repo on the SD card, removed the remote, and tarred the result to work.tar.
import os
import subprocess
jrsmith3 / jrsmith3.gitignore
Last active Dec 19, 2015
my generic gitignore
View jrsmith3.gitignore
# jrsmith3.gitignore
# ==================
# This file can be found at the following URL:
# This file was created by merging some of the
# gitignores found in
# License
# -------
jrsmith3 /
Created May 6, 2013
Round a value to an integer [1-9] times a power of 10. How would you write a test for this method?
import numpy as np
def round_exponential(val):
Round a value to an integer [1-9] times a power of 10.
>>> val1 = 7.83126342297e-07
>>> print round_exponential(val1)
>>> 8e-07
You can’t perform that action at this time.