Skip to content

Instantly share code, notes, and snippets.

@paultopia
Last active November 30, 2015 20:16
Show Gist options
  • Save paultopia/8586ad72668037ec151e to your computer and use it in GitHub Desktop.
Save paultopia/8586ad72668037ec151e to your computer and use it in GitHub Desktop.
The toolchain of a techy-ish political theorist/lawyer

My toolchain (on OSX)

I do all four of the following often:

  1. Write lengthy academic prose.

  2. Write code.

  3. Analyze data and do other math-y things.

  4. Teach and give presentations.

I've been poking around for a toolchain that will let me do all of those things, preferably with as few multi-purpose, well-rounded apps as possible, and if at all possible without using anything made by Microsoft (because, let's be realistic, everything that company has ever written has been terrible, with the possible exception of the Outlook app for iOS). I use a specced out (i7, 16g ram) 13in retina MBP running el capitan from around 2013.

This document serves two purposes. First, it's a useful way for me to keep track of good resources all in one place---it's helpful to have a list of one's own software if only for purposes of discipline and habit, as a prod to go to a standard tool rather than investing the time and struggle to find a new one for some feature. Second, I think my toolchain works, and for those who have similar needs but don't know what to use (particularly grad students in the social sciences), you could do worse than to just adopt some of it.

This my setup probably isn't suitable for truly heavy duty work in any of those areas. Specifically, it isn't suitable for (1) desktop publishing or extremely heavy-duty mathematical publishing like economists do (in both cases, use LaTeX), (2) heavy-duty industrial writing of production code with tens of thousands of lines across many files (use emacs/vi/your favorite IDE), (3) big-data-datascience (actually, you can get pretty close for that with my toolset, but you should probably get yourself some distributed computing capacity), or (4) TED talks or some such (no clue what would work for that, actually.).

Key Tools

  1. Atom is my text editor. I'm slowly migrating everything I write to it and clearing the darkness of MS Word out of my soul. It combines the best of the hard-core unix text editors like emacs and vim (infinite extensibility, reasonable speed for most tasks) with the best of modern GUI apps (the ability to get up and running in a basic form quickly, without having to learn a whole new ontology, no crap like "buffers" and "insertion mode" etc.---Atom has a very short learning curve to get going). I've also heard good things about Sublime Text, but Atom is free and Sublime Text costs 70 bucks. For coders, there's syntax highlighting and code completion for basically every language provided through packages, and you can write your own extensions in javascript; there are also a ton of themes, markdown preview, code folding, etc. The existing package ecosysystem also has neat stuff like the ability to open a terminal window within the app. The one downside is that Atom is build on a bunch of Chrome stuff, and has all the vices you'd expect from that: it really loves to gobble up system resources. Its CPU and memory use don't bother me, because my machine is specced out, but the battery use can really hurt.

  2. Markdown is a super-lightweight plain text markup syntax that is easy to convert to other formats in an automatic way. There are also a million extensions to it (this document, for example, is written in markdown but interpreted by github in their own flavor of the syntax). It was originally designed to convert to html, but there are tools to convert it to basically anything else. I use the pandoc extensions to markdown (see next item), which provides nice things like footnotes, intergration with MathJax for equations (which I haven't tried yet), etc.---basically all you need to write academic papers. (It also has reference manager integration, but I haven't tried that yet.)

  3. Pandoc is the god of text conversion. It can convert essentially anything to anything else---html, pdf (with latex installed---just use mactex), even word docx. Conversion from those formats doesn't necessarily support every feature, but the really big trick is that it has its own flavor of markdown, full of useful extensions, and can instantly convert that to any of the other formats. This is huge: you can write once, in a simple markup language, and output the same document in html, word (if you must, e.g. for journals or for sharing with less technically inclined others), and pdf; you also only have to learn one tool and everything else just works. Pandoc is also templatable, so you can control the output formats, although the defaults are pretty sensible. In my experience, this application is essentially flawless.

  4. Python---Anaconda distribution is the most straightforward programming language in the most complete package. I use Python for almost every coding task, because it's just vastly easier to write almost anything in Python than in any other language --- the syntax doesn't get in your way, there are good libraries for essentially every purpose, there's a massive user community (helps when you need to turn to stackoverflow), I <3 Python. I don't have a dog in the 2.x vs 3.x fight, and use either depending on what mood I happen to be in any given moment. (I like the print statement rather than function from 2, but I also like the improved unicode handling and non-leaky-scope in list comprehensions from 3.) The Python interpreter that comes with OSX is obsolete; the easiest solution to update it is to use the Anaconda distribution, which packages up-to-date versions of either 2.x or 3.x with a ton of extremely useful packages, including most importantly a) the whole data science stack (numpy, matplotlib, pandas, scikit-learn, etc.) and b) ipython and the ipython notebook, which are, respectively, an enhanced interpreter (REPL) with nice things like tab completion, up-arrow history, etc, and a ridiculously amazing way to run python interactively from a webpage and display and save output. Anaconda also comes with not only the standard package manager (pip) but its own enhanced package manager (conda) which is good at installing stuff but also at creating virtual environments and such (which allows you to do things like seamlessly switch back and forth between 2.x and 3.x).

Code and data

Python: anaconda (both versions), textmining (easier than nltk for basic stuff)

R: rstudio, ggplot (and the rest of the hadleyverse) clean plots a good ggplot cheatsheet less necessary with ggplot port to python

github (obvs) with gui tool

Text/Resisting the MSWord Monstrosity

pandoc

atom

Packages and System

node.js and npm --- the latest stuff these days tends to require flashy node stuff

homebrew

Images

Graphviz learning: d3.js

Presentations

I've been stuck on powerpoint on a while, but intend to try reveal.js. It looks like reveal has support for everything I want, including built in remote support from either clickers or mobile web, as well as at least one pandoc template. More remote stuff: this is super-easy, this looks like a good option for server-side remote. Pandoc template and python script to churn them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment