This file contains hidden or 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 | |
| # encoding: utf-8 | |
| """ | |
| split_ln.py | |
| Created by Neal Caren on 2012-05-14. | |
| [email protected] | |
| Edited by Alex Hanna on 2015-01-29 | |
| [email protected] |
This file contains hidden or 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
| # toggle iTerm Dock icon | |
| # add this to your .bash_profile or .zshrc | |
| function toggleiTerm() { | |
| pb='/usr/libexec/PlistBuddy' | |
| iTerm='/Applications/iTerm.app/Contents/Info.plist' | |
| echo "Do you wish to hide iTerm in Dock?" | |
| select ync in "Hide" "Show" "Cancel"; do | |
| case $ync in | |
| 'Hide' ) |
This file contains hidden or 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
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains hidden or 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 ruby | |
| # Uses the Readability Metrics API from http://ipeirotis.appspot.com/readability-api.html | |
| # Accepts text from STDIN (piped) or as an argument | |
| =begin examples | |
| pbpaste|text_score.rb # copy text and run (on OS X) to get the stats for the clipboard. | |
| cat myfile.md|text_score.rb # get scores for the contents of a file | |
| =end | |
| require 'open-uri' | |
| require 'net/http' |
This file contains hidden or 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
| class FullPaths(argparse.Action): | |
| """Expand user- and relative-paths""" | |
| def __call__(self, parser, namespace, values, option_string=None): | |
| setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
| def is_dir(dirname): | |
| """Checks if a path is an actual directory""" | |
| if not os.path.isdir(dirname): | |
| msg = "{0} is not a directory".format(dirname) | |
| raise argparse.ArgumentTypeError(msg) |
This file contains hidden or 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 ruby | |
| bibfile = "~/.pandoc/default.bib" | |
| matches = ARGF.read.scan(/@(.*?)[\.,:;\] ]/) | |
| reg = "\\(" + matches.join("\\)\\|\\(") + "\\)" | |
| system 'bibtool -X \'' + reg + '\' ' + bibfile |
This file contains hidden or 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
| # original XML at http://www.w3.org/Math/characters/unicode.xml | |
| # XSL for conversion: https://gist.github.com/798546 | |
| unicode_to_latex = { | |
| u"\u0020": "\\space ", | |
| u"\u0023": "\\#", | |
| u"\u0024": "\\textdollar ", | |
| u"\u0025": "\\%", | |
| u"\u0026": "\\&", |
This file contains hidden or 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/ruby | |
| ## get a sorted list of cite keys that match an array of strings | |
| ## | |
| ## Usage: | |
| ## | |
| ## $ bibkey citekey1 [citekey2 ...] | |
| ## $ bibkey path-to-bibtex citekey1 [citekey2 ...] | |
| ## | |
| ## if the first argument is a path to a readable file, then the |
NewerOlder