Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| (function(){ | |
| var button_id = "download" | |
| // include this code in your page | |
| // you must have jQuery installed | |
| // you must have a link element with an id of "download" | |
| // this is limited to only one chart on the page (the first) | |
| function encode_as_link(){ | |
| // Add some critical information |
| # Google Art Project fullsize image downloader. | |
| # By Henrik Nyh <http://henrik.nyh.se> 2011-02-05 under the MIT license. | |
| # Requires Ruby and ImageMagick. | |
| # | |
| # NOTE: | |
| # I'm afraid this script no longer works! See the Gist comments. | |
| # | |
| # Usage e.g.: | |
| # ruby google_art_project.rb http://www.googleartproject.com/museums/tate/portrait-of-william-style-of-langley-174 | |
| # |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # requires biopython | |
| # run like: | |
| # genbank_to_tbl.py "my organism name" "my strain ID" "ncbi project id" < my_sequence.gbk | |
| # writes seq.fsa, seq.tbl as output | |
| import sys | |
| from copy import copy | |
| from Bio import SeqIO | |
| def find_gene_entry(features, locus_tag): |
| from area53 import route53 | |
| from boto.route53.exception import DNSServerError | |
| import requests | |
| import sys | |
| from datetime import datetime | |
| # Modified from https://markcaudill.me/blog/2012/07/dynamic-route53-dns-updating-with-python/ | |
| domain = 'domain.tld' | |
| subdomain = 'subdomain_name' |
| import os | |
| import imp | |
| def importFromURI(self, uri, absl=False): | |
| if not absl: | |
| uri = os.path.normpath(os.path.join(os.path.dirname(__file__), uri)) | |
| path, fname = os.path.split(uri) | |
| mname, ext = os.path.splitext(fname) | |
| no_ext = os.path.join(path, mname) |
| ################# | |
| #### MODULES #### | |
| ################# | |
| $ModLoad imuxsock # provides support for local system logging | |
| $ModLoad imfile | |
| ########################### | |
| #### GLOBAL DIRECTIVES #### | |
| ########################### |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |