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 BaseKitty | |
def meow | |
nil | |
end | |
end | |
class Nancy < BaseKitty | |
def meow | |
(super || "shshsh") | |
end |
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 | |
require "open-uri" | |
require "parallel" | |
open("https://ftp.ncbi.nlm.nih.gov/genomes/refseq/bacteria/assembly_summary.txt") do |handle| | |
handle.gets # skip header | |
handle.gets | |
Parallel.each(handle, :in_processes => 6, :progress => 'downloading') do |line| | |
row = line.split("\t") |
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
2017-04-01 2017-10-01 The Bear & Peacock Brewery Orlando, FL | |
2017-02-01 Nude Nite Orlando, FL | |
2016-09-01 Small Works Show City Arts Factory Orlando, FL | |
2016-08-01 Declaration of the Mind 1st Thursdays Orlando Museum of Art, FL | |
2016-07-01 Rock (People's Choice Award Winner) 1st Thursdays, Orlando Museum of Art, FL | |
2016-03-01 Viva La Diva 1st Thursdays, Orlando Museum of Art, FL | |
2016-03-01 Nude Nite Tampa, FL | |
2016-02-01 Peace and Harmony 1st Thursdays, Orlando Museum of Art, FL | |
2016-10-01 Winter Park, FL | |
2012-08-01 Vegas Gallery, Las Vegas, AZ |
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
def one_hot_encode(sequence: str, alphabet=["G", "A", "T", "C"]): | |
""" | |
one-hot encode a string using a pre-defined alphabet | |
>>> one_hot_encode("GATC") | |
[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] | |
""" | |
vector = ([0] * len(alphabet)) * len(sequence) |
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 python3 | |
from models import * | |
def query(func): | |
def run_query(): | |
rows = get_database().execute_sql(func.__doc__.strip()) | |
for row in rows: |
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 python3 | |
import argparse | |
import random | |
import sys | |
import xopen | |
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
from collections import defaultdict | |
import statistics | |
import random | |
class InfiniteMedian: | |
""" | |
Works well if the number of possible values is low. | |
Otherwise, nicht sehr gut | |
""" |
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/bash | |
set -euo pipefail | |
container_substring="something-greppable-in-the-name" | |
function check { | |
docker ps | grep -v CONTAINER | grep -v ${container_substring} | |
} |
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 python3 | |
import xml.etree.ElementTree as ET | |
from pprint import pprint | |
import code | |
tree = ET.parse('biosample_result.xml') | |
def expand_blob(blob, attributes={}): | |
''' |