Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shawnhermans
shawnhermans / submit-job.sh
Last active February 18, 2016 05:09
A script that runs Python-based Spark jobs by bundling requirements defined in a requirements.txt file. It downloads wheel archives which are zip files. I haven't done extensive testing on this yet, but it seems to work.
#!/usr/bin/env bash
TMP_DIR=`mktemp -d`
cp spark_test.py ${TMP_DIR}
cp requirements.txt ${TMP_DIR}
cd ${TMP_DIR}
pip wheel -r requirements.txt
PY_FILES=$(ls -m *.whl | tr -d ' ' | tr -d '\n')
spark-submit --py-files ${PY_FILES} spark_test.py
\begin{itemize}
\item This is the first item of an itemized list.
Each item in the list is marked with a ``tick''.
You don't have to worry about what kind of tick
mark is used.
\item This is the second item of the list. It
contains another list nested inside it. The inner
list is an \emph{enumerated} list.
\begin{enumerate}

This is a longer quotation. It consists of two paragraphs of text, neither of which are particularly interesting.

This is the second paragraph of the quotation. It is just as dull as the first paragraph.

@shawnhermans
shawnhermans / latex-quotation.tex
Created December 16, 2015 21:14
Example of a LaTeX quotation
\begin{quotation}
This is a longer quotation. It consists of two
paragraphs of text, neither of which are
particularly interesting.
This is the second paragraph of the quotation. It
is just as dull as the first paragraph.
\end{quotation}
@shawnhermans
shawnhermans / markdown-example.md
Created December 16, 2015 19:19
Simple example of Markdown

Heading 1

Heading 2

  • Bullet 1
  • Bullet 2
  • Bullet 3

Heading 3

Chapter 1 - Herbert A. Simon and Craig A. Kaplan

From a sociological standpoint, disciplines are defined less by their intellectual structure and content than by the scientists who identify with them. But more accurately, over time the intellectual content of a discipline gradually defines its boundaries and membership, whereas its membership gradually redefines its content.

@shawnhermans
shawnhermans / create-iso.sh
Created September 23, 2015 15:58
Script I used to create a Yosemite ISO image
#!/bin/bash
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Yosemite.sparseimage
@shawnhermans
shawnhermans / encode.sh
Created September 21, 2015 17:33
Example of command line encoding with ffmpeg
ffmpeg -i $1 -codec:v libx264 -profile:v high -preset slower -crf 25 -threads 0 -codec:a libfdk_aac -b:a 128k -f mp4 $2