Skip to content

Instantly share code, notes, and snippets.

Naveen Arunachalam naveenarun

Block or report user

Report or block naveenarun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@naveenarun
naveenarun / slack.sh
Last active Jul 22, 2019
Bash function for sending a verbose slack message (containing path, command, error code, and custom message) after a process or series of processes exit
View slack.sh
# Place this in your .bashrc
# Covers several corner cases such as nested apostrophes, history extraction in screens/subshells, Slack being down, etc.
# Strings to replace with your own credentials:
## {your email address} (1 instance)
## {slack webhook url} (1 instance) (see guide below)
## {your computer name} (2 instances)
# How to set up a Slack webhook (as of Jul 2019):
## Go here: https://api.slack.com/apps?new_app=1.
## Click “incoming webhooks” and turn the slider on
@naveenarun
naveenarun / get_rxns.sh
Last active Mar 5, 2019
Reaction List [cite as "Naveen Arunachalam, 10.65 (Spring 2019)"]
View get_rxns.sh
cat rtable_raw.txt | grep '^R' | sed 's/R\(.\{1,2\}\)/\1/g; s/\([0-9]\.\).*$//g; s/( + M)//g; s/\([a-zA-Z]*\) \([1-9]\)\( \)\?\(-[1-9]\)\?/\1\2\4/g; s/\([+=]\)/ \1 /g' > rxns.txt
cat rxns.txt | sed 's/^[0-9]\{1,2\}//g; s/^\(.*\)=\(.*\)/\1\n\2/g' | awk '{ for(i = 1; i <= NF; i++) { if ($i!="+") {print tolower($i)} } }' | sed 's/^[0-9]//g' | sort -u > species.txt
cat rxns.txt | sed 's/^..\? //g; s/ [0-9]\(.*\)/ \1 + \1/g' | awk '{print tolower($0)}' > rxns_refined.txt
You can’t perform that action at this time.