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
/* _optimizely_evaluate=force */ | |
$(window).load(function() { | |
var experimentID = TODO_PASTE_IN_HERE; // ex: 9876543210 | |
try { // wait till window.load so ga exists via segment.io | |
var cookieName = 'ga_optimizely_' + experimentID; | |
if (!getCookie(cookieName)) { | |
setCookie(cookieName, 'sent', 30 * 60); // resend every 30m |
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 | |
import argparse | |
def get_letter_grade(points): | |
"""Return letter grade (A-F) based on 100 point scale""" | |
if points >= 90: | |
return 'A' | |
elif points >= 80: | |
return 'B' |
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 | |
import requests | |
r = requests.get("http://www.telize.com/geoip/46.19.37.108") | |
json_object = r.json() | |
print(json_object['latitude']) | |
print(json_object['longitude']) |
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 | |
## Read two GRAALy files and produce a new, improved | |
## hetero_contacts table using different indices. | |
## It's complicated. | |
import sys | |
INFO_CONTIGS_FILE = "info_contigs.txt" | |
FRAGMENTS_HETERO_FILE = "fragments_hetero_contacts.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
#!/usr/bin/env python3 | |
import sys | |
# Check command line arg | |
if len(sys.argv) != 2: | |
sys.stderr.write("usage: replace_first_column_with_nine_spaces.py <input.tsv>\n") | |
sys.exit() | |
# Open 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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
[bhall@moana][~]> module list | |
Currently Loaded Modulefiles: | |
1) rocks-openmpi | |
[bhall@moana][~]> echo $PERL5LIB | |
[bhall@moana][~]> echo $PERL5INC | |
[bhall@moana][~]> echo $INC |
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 | |
import sys | |
if len(sys.argv) < 2: | |
sys.stderr.write("usage: write_two_files.py <filename prefix>\n") | |
sys.exit() | |
prefix = sys.argv[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
elif line.startswith("alleles"): | |
#this is the second line | |
alleles = line.strip().split()[1:] | |
else: # This "else" is currently on line 64 | |
columns = line.split() | |
individual_info = get_ind_info(columns) | |
# I chopped out a bunch of stuff here | |
group = individual_info['group'] |
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
#!/bin/bash | |
# we want to know how many files in this directory contain the string 'bar' | |
number_of_matches=`ls | grep -c bar` | |
# uncomment the following line to see how many matches you got: | |
#echo $number_of_matches | |
# if only one match, let me know | |
if [[ $number_of_matches -eq 1 ]] |