Skip to content

Instantly share code, notes, and snippets.

View wcaleb's full-sized avatar

W. Caleb McDaniel wcaleb

View GitHub Profile
@wcaleb
wcaleb / evidence.md
Created January 14, 2015 20:38
Draft Rubric for Evidence

2. Evidence

Thoroughly support and revise your claims about the past using critical approaches to the best and most relevant available evidence.

Emerging practice: As a novice historian, you may assume that the number of claims about the past still needing specific, empirical substantiation is relatively small. You will often make claims without giving specific evidence to support them, or you may give evidence that is over-general, under-examined, or not sourced. At this stage, you may use only a small portion of the evidence available to you from course readings and classes. Evidence is often accepted uncritically by beginners, who show little awareness of source problems or the differences between primary and secondary accounts. Sources are treated as straightforward bearers of information that give unfettered access to their creators' thinking.

As you begin to develop competence in dealing with evidence, you will make sure that claims needing substantiation with evidence always receive it, tho

@wcaleb
wcaleb / narrativity.md
Created January 14, 2015 19:34
Draft Rubric for Narrativity

1. Narrativity

Craft complex historical narratives that answer a question or solve a problem using sophisticated understandings of causation, continuity, and change over time.

Emerging practice: Historical narratives written by beginning students of history are often simple, sequential accounts that tell readers "what happened" without indicating why the narrative matters. To beginners, one way of telling the story is as good as any other. It is difficult to tell why certain topics or things are included and others are not; obviously relevant issues are ignored, while tangential issues are included. Attempts to tie events together as cause and effect, or as evidence of change or continuity, are weak, simplistic, logically fallacious, or non-existent.

As you begin to develop competence, you will begin to write narratives that are oriented towards solving a problem or answering a question, though the stakes of the problem or question may be unclear and the answer attempted by the narrative may not y

@wcaleb
wcaleb / course-description.md
Last active August 29, 2015 14:12
Draft Course Description for HIST 118

Course Description

In this class, we will be exploring the history of the United States over the last 165 years or so. But this will not be a typical history "survey" of the sort you might be accustomed to from high school. It will be different in at least three ways:

Big Difference #1

We will not even attempt to "cover" everything; instead, we will "uncover" what historians do.

Instead of attempting to cram every person, place, and thing that was important in this period into your head, I want to introduce you to what U.S. historians actually do. So instead of organizing our study around the question of "What happened next?" we will be considering bigger questions, like these:

@wcaleb
wcaleb / perry.md
Created November 26, 2014 04:20
Snippets from my review of Lewis Perry, Civil Disobedience

From forthcoming review of Lewis Perry, Civil Disobedience: An American Tradition (New Haven: Yale University Press, 2013), in Journal of the Gilded Age and Progressive Era

[...] Activists in the Progressive Era also accelerated the "Americanization of civil disobedience" by self-consciously claiming to be heirs of the nation's democratic traditions and by exhibiting a general reverence for American institutions and laws; they usually accepted the legal penalties for their disobedience (143). With inventive new legal strategies designed to create test cases in the courts, Progressive Era reformers helped join the threads of a distinctively American civil disobedience---active, but peaceful, confrontation with authorities, combined with a willingness to suffer whatever legal penalties resulted from such noncooperation. Yet in doing so, they also bequeathed to later generations an American tradition of differentiating between legitimate and illegitimate forms of civil disobedience. That process of dif

@wcaleb
wcaleb / everythree.py
Created November 15, 2014 06:33
A Twitter bot about the magnitude of the domestic slave trade
#!/usr/bin/python
import random, twitter # https://github.com/bear/python-twitter
from OAuthSettings import settings
log_file = '/home/wcm1/.e3m'
api_key = settings['consumer_key']
api_secret = settings['consumer_secret']
access_token = settings['access_token_key']
access_token_secret = settings['access_token_secret']
@wcaleb
wcaleb / inlinenotes.py
Last active December 29, 2020 06:59
Pandoc filter to convert all notes to inline notes in Pandoc Markdown output
#!/usr/bin/env python
from pandocfilters import toJSONFilter, RawInline, Space, Str, walk
"""
Pandoc filter for Markdown that converts most endnotes into
Pandoc's inline notes. If input notes had multiple paragraphs,
the paragraphs are joined by a space. But if an input note
had any blocks other than paragraphs, the note is left as is.
"""
@wcaleb
wcaleb / omekaclient.py
Last active September 19, 2019 18:30
Turn JSON from Omeka API items resource into CSV file
# https://github.com/jimsafley/omeka-client-py
import httplib2
import urllib
import mimetypes
class OmekaClient:
def __init__(self, endpoint, key=None):
self._endpoint = endpoint
self._key = key
"""
This script ingests a CSV exported from Library Thing and
returns the percentage of author last names that begin with
each letter of the alphabet.
Based on original script by Andrew Pendleton for analyzing
U.S. Census data: https://gist.github.com/apendleton/2638865
"""
@wcaleb
wcaleb / rename.py
Created July 8, 2014 21:08
Renaming PH2 lesson files after wget download
import os
from bs4 import BeautifulSoup
files = os.listdir('.')
for file in files:
html = open(file, 'r').read()
soup = BeautifulSoup(html)
url = soup.find(rel='canonical')['href']
open(url.split('/')[-1] + '.html', 'w').write(html)
@wcaleb
wcaleb / getbibs.py
Last active April 4, 2022 15:36
The Pandoc filter and shell script I use to make a bibliography file from my BibTeX note files. See http://wcm1.web.rice.edu/plain-text-citations.html
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Pandoc filter that grabs the BibTeX code block from each note file
# and then uses bibtexparser to add a "short title" entry in the "note" field,
# appending finished BibTeX entry to a bibliography file.
from pandocfilters import toJSONFilter, CodeBlock
# https://github.com/sciunto/python-bibtexparser
import bibtexparser