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 | |
# $: blindly copy commands from the internet | |
"$@" |
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 | |
# calc: preform fast calculations on the go | |
# | |
# Tired of having to open a new terminal, run `bc`, type the calculation, only | |
# to exit right after seeing the answer? Suffer no longer! Now just type | |
# `calc 2+2` and instantly see the answer! | |
echo "$@" | bc -l |
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 | |
# g: tiny git wrapper | |
if [[ $# -eq 0 ]]; then | |
git status | |
else | |
git "$@" | |
fi |
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 | |
# tg: quickly tag files | |
# | |
# Rename files based on the given tag. For example `tg old file.txt` changes | |
# `file.txt` to `file-old.txt`. If the file already contains the suppied tag, | |
# it is removed. | |
if [[ $# != 2 ]]; then | |
printf "usage: tg TAG FILE \n" |
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 | |
# ED: change between $EDITORs | |
# | |
# Toggles your $EDITOR between your different editors. | |
# To install add `source path/to/ED.sh` to your shell's rc file. | |
ED() { | |
local new | |
if [[ "$1" != "" ]]; then |
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 | |
# echk: functions to display shell error code | |
echk_color() { | |
# set color depending on if the last command succeed or not | |
if [[ $? -eq 0 ]]; then | |
echo -ne "\033[0;32m" | |
return 0 | |
else |
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 | |
# pub: prepare post to be published | |
# | |
# Moves given draft into the posts directory and prefixes the filename with the | |
# date so that it is ready to be published. | |
if [[ $# == 0 || $# > 2 || ! -f "$1" ]]; then | |
echo "usage: pub FILE [POSTDIR]" | |
exit 1 |
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 | |
""" | |
Convert clustal alignment files to grishin format for use in Rosetta | |
protein homology simulatoins | |
Author: Ed van Bruggen <edvb@uw.edu> | |
""" | |
import argparse | |
from argparse import RawTextHelpFormatter |
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 | |
# body: print the body of a file | |
# | |
# if only two arguments are given print the file given by the first at the line | |
# number from the second. If a third argument is given print until that line. | |
if [[ $# == 2 ]]; then | |
sed -n $2p $1 | |
elif [[ $# == 3 ]]; then |
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 | |
# sett: set title of a terminal | |
# | |
# Change the title of any terminal window. If no argument is given it sets the | |
# title to the working directory, otherwise the supplied TITLE is used. | |
title=$1 | |
if [[ -z $title ]]; then | |
title="$(basename "$PWD")" |
OlderNewer