This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ================================================================================ | |
# A git-diftool utility for a TeX file using `latexdiff`. | |
# | |
# | |
# Usage | |
# ----- | |
# git latexdiff [<commit>] | |
# git latexdiff --cached [<commit>] | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""My usercustomize.py on Mac OS X""" | |
import os | |
import site | |
import sys | |
SUFFIX = 'lib/python{0}/site-packages'.format(sys.version[:3]) | |
site.USER_BASE = os.path.expanduser(os.path.join('~', '.local')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Call ipython with a per-project profile. It assumes that .ipython directory | |
# is in the top level directory of a project managed by git. | |
function ipython() { | |
local project_root_dir | |
# If the user specifies `IPYTHONDIR` either by giving --ipython-dir | |
# option or by an environmental variable IPYTHONDIR, then the specified | |
# directory should have precedence over per-project `IPYTHONDIR`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
import itertools | |
import struct | |
def scan_fortran_unformatted(fname, marker_size=4): | |
"""Scan records of a Fortran unformatted file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
\unalias -a | |
# Print the usage and exit.. | |
# | |
print_usage_and_exit() { | |
cat <<EOF | |
Usage: init_data_analysis_project [-h|--help] PROJECT_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
import argparse | |
import datetime | |
import calendar | |
import ephem | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div#notebook-container { | |
width: 105ex; | |
} | |
div.cell { | |
margin-left: auto; | |
margin-right: auto; | |
} | |
div.text_cell_render { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import functools | |
from lib import lxcat | |
txt_file = '20131029_Electron_Scattering_Swarm_Data_Dutton_1975.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import zipfile | |
def extract_zipfile(filename, dest_dir): | |
"""Extract all files in a ZIP file while preserving date and time. | |
See http://stackoverflow.com/a/9813471. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Add the top directory of a git-managed project to `sys.path`.""" | |
import os | |
import shlex | |
import subprocess | |
import sys | |
cmd = 'git rev-parse --show-toplevel' |
OlderNewer