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
wtf -- list specified command options of a bash command | |
EXAMPLE | |
------- | |
$ wtf rsync -rvcl src/ dest/ | |
-r, --recursive recurse into directories | |
-v, --verbose increase verbosity | |
-c, --checksum skip based on checksum, not mod-time & size |
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
position | |
positive | |
negative | |
temperature | |
potential | |
calculate | |
point | |
permittivity | |
boltzmann | |
mass |
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 requests | |
def doi2bib(doi): | |
""" | |
Return a bibTeX string of metadata for a given DOI. | |
""" | |
url = "http://dx.doi.org/" + doi | |
headers = {"accept": "application/x-bibtex"} |
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
from plasTeX.TeX import TeX | |
# The following can be a problem if you are using revtex. | |
doc = TeX(file="filename.tex").parse() | |
refs = doc.getElementByTagName("cite") | |
cites = [] | |
for ref in refs: |
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
# -*- coding: utf-8 -*- | |
import pycurl | |
import StringIO | |
from pybtex import auxfile | |
from pybtex.database.input import bibtex as bibtexin | |
from pybtex.database.output import bibtex as bibtexout | |
import pybtex.database | |
def doi2bib(doi): | |
""" |
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 numpy as np | |
def round_exponential(val): | |
""" | |
Round a value to an integer [1-9] times a power of 10. | |
Example | |
>>> val1 = 7.83126342297e-07 | |
>>> print round_exponential(val1) | |
>>> 8e-07 |
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
# jrsmith3.gitignore | |
# ================== | |
# | |
# This file can be found at the following URL: | |
# https://gist.github.com/jrsmith3/6031841 | |
# This file was created by merging some of the | |
# gitignores found in https://github.com/github/gitignore | |
# | |
# License | |
# ------- |
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
# -*- coding: utf-8 -*- | |
""" | |
I used the following script to convert each subdirectory of work.git into its own git repo. The one exception was paper-2013.01.16_nea_collector which I did by hand using essentially the same method as below, except I skipped the part where I removed the tags. I used the procedure found at [1] and slightly modified it. I also used the solution in [2] to convert non-bare repos to bare. Note also that I first cloned work from its bare git repo on the SD card, removed the remote, and tarred the result to work.tar. | |
[1] http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository | |
[2] http://stackoverflow.com/questions/1784506/when-creating-a-git-repository-that-will-be-on-the-server-can-i-convert-it-to-a | |
""" | |
import os | |
import subprocess |
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
""" | |
Convert every .sla to a pdf in a specified directory. | |
This script can only be run from within [scribus](http://http://scribus.net). | |
""" | |
import os | |
work_dir = #you have to explicitly tell scribus where your working directory is. | |
filenames = os.listdir(work_dir) |
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
""" | |
This script was used to create the figures for http://jrsmith3.github.io/sample-logs-the-secret-to-managing-multi-person-projects.html from a PDF file containing some old CMU sample logs. | |
""" | |
import PyPDF2 | |
from wand.image import Image | |
import io | |
import os | |
OlderNewer