Skip to content

Instantly share code, notes, and snippets.

View shamrt's full-sized avatar

Shane Martin shamrt

View GitHub Profile
import os
def test_user_input(monkeypatch):
inputs = [10, 'y']
input_generator = (i for i in inputs)
monkeypatch.setattr('__builtin__.raw_input', lambda prompt: next(input_generator))
assert raw_input('how many?') == 10
assert raw_input('you sure?') == 'y'
@shamrt
shamrt / journal_list.py
Created April 7, 2016 00:07
Scripts for Python Programs to Start Digging Into JSTOR’s Early Journals
# PROGRAM NAME: journal_list.py
# Displays the title of every journal in the JSTOR Early Journal Content Data Bundle.
# Highlights those with "Psych" or "Philos" in the title (+ two general science journals).
# Displays the filename of the first article for each journal.
# Written by Christopher D Green
# January 2014
# Modified by (if you modify this program, put your name here.)

Keybase proof

I hereby claim:

  • I am shamrt on github.
  • I am shamrt (https://keybase.io/shamrt) on keybase.
  • I have a public key whose fingerprint is 4641 ADA1 1D9C 8590 CF72 9FF2 E8CC 3B0D 8C56 0EBB

To claim this, I am signing this object:

@shamrt
shamrt / Makefile
Last active November 18, 2015 01:12
Quickly setup a RevealJS slideshow
SLIDES_MD = presentation.md
GENERATED_SLIDES = index.html
PWD = $(shell pwd)
SHELL = /bin/bash
REVEALJS_VERSION = 2.6.2
REVEALJS_DIR = reveal.js
REVEALJS_FILENAME = $(REVEALJS_VERSION).tar.gz
REVEALJS_THEME = solarized
@shamrt
shamrt / previewtemplate.tex
Created December 16, 2014 18:29
BibDesk preview template for APA style (version 6)
\documentclass{apa6e}
\pagestyle{empty}
\textwidth = 7in
\voffset = -90pt
\hoffset = -40pt
\renewcommand{\refname}{}
% The following command is provided for LaTeX2RTF compatibility with amslatex.
\newif\iflatextortf
\iflatextortf
@shamrt
shamrt / solarized_improved.css
Last active August 29, 2015 14:07
An improved version of the Solarized theme for reveal.js (v2.6.2). Add to css/theme folder of reveal.js package.
@import 'solarized.css';
/**
* Improved Solarized Light theme for reveal.js.
* Author: Shane Martin (origin author: Achim Staebler)
* Requires solorized.css theme (comes pre-installed)
*/
/* Large font */
.reveal {
font-size: 30px; }
@shamrt
shamrt / Gemfile
Created July 11, 2013 19:26
Padrino application setup with Compass
## Add to your Padrino Gemfile…
# Assets
gem 'sass'
gem 'uglifier'
gem 'sinatra-assetpack'
gem 'sinatra-support', :require => 'sinatra/support/compasssupport'
# Component requirements
gem 'haml'
// @author: Shane Martin
// @creation: 2010-01-21
//
// @description:
// Simple column by percentage; useful for result sets and forms. For the
// `percent-column` mixin the `!margin` variable is optional.
//
// @requires: chriseppstein/compass or the mixins used below from the Compass project
// @example:
// Styling a set of twitter results into two columns.