Skip to content

Instantly share code, notes, and snippets.

@hgbrian
hgbrian / tennis_atp_heights_weights.tsv
Last active July 13, 2024 01:59
tennis_atp_heights_weights.tsv
name sex height weight
Alexandrova Ekaterina F 1.75 69
Andreescu Bianca F 1.7 67
Anisimova Amanda F 1.8 71
Azarenka Victoria F 1.83 72
Badosa Paula F 1.8 71
Begu Irina-Camelia F 1.81 71
Bencic Belinda F 1.75 69
Bogdan Ana F 1.71 67
Bondar Anna F 1.72 68
@hgbrian
hgbrian / rio_2016_heights_weights.tsv
Last active July 12, 2024 22:39
rio_2016_heights_weights.tsv
name country sex DOB age height weight event
Usain Bolt JAM M 1986-08-21 30.02 1.96 95.0 100m
Margaret Nyairera Wambui KEN F 1995-09-15 20.95 1.71 66.0 800m
Shadrack Kipchirchir USA M 1989-02-22 27.52 1.73 53.0 10,000m
Alia Saeed Mohammed UAE F 1993-11-13 22.79 1.58 54.0 10,000m
Alice Aprot Nawowuna KEN F 1994-01-02 22.65 1.52 54.0 10,000m
Andrew Vernon GBR M 1986-01-07 30.64 1.82 71.0 10,000m
Bedan Karoki Muchiri KEN M 1990-08-21 26.02 1.7 54.0 10,000m
Ben St Lawrence AUS M 1981-11-07 34.81 1.79 65.0 10,000m
Beth Potter GBR F 1991-12-27 24.67 1.7 51.0 10,000m
@hgbrian
hgbrian / ESM3_GFP_alignment.html
Created June 25, 2024 22:22
ESM3 GFP alignment
<html style="background:black;width:30000px"><span style="font-family:monospace; color: green;">ESM3_GFP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:monospace; color: green;">M</span><span style="font-family:monospace; color: green;">S</span><span style="font-family:monospace; color: green;">K</span><span style="font-family:monospace; color: red;">V</span><span s
"""Use Whisper and llama3 to transcribe and summarize a podcast.
"""
from pathlib import Path
import modal
from modal import Image, App, method
LOCAL_OUT = REMOTE_OUT = "./out/podcast_summarize"
GPU = modal.gpu.A10G()
@hgbrian
hgbrian / in_parallel.py
Last active February 16, 2020 01:16
parallelize for loop
import pandas as pd
def expo(x, y):
return pd.DataFrame([[x, y, x**y]], columns=['x', 'y', 'x^y'])
def in_parallel(fn, loops=None, is_product=False, num_workers=8, *args, **kwargs):
from warnings import warn
from dask import compute, delayed
from itertools import product
import pandas as pd
@hgbrian
hgbrian / gist:c9727e1c02c72895c171
Created April 27, 2015 15:15
Bayesian Linear Regression
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Fancy Bayesian Linear Regression\n",
"=================\n",
"Take some data and regress a few different ways."
]
@hgbrian
hgbrian / gist:9290e45b05f68291e545
Created April 19, 2015 20:01
Kruschke's Doing Bayesian Data Analysis in PyMC3
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Kruschke in PyMC3\n",
"=========\n",
"\n",
"Based on https://github.com/aloctavodia/Doing_bayesian_data_analysis with minor edits."
@hgbrian
hgbrian / gist:fac93c888da42a2c5581
Created August 15, 2014 23:40
Flagellin alignment: IDT vs Life vs JCAT
CLUSTAL O(1.2.1) multiple sequence alignment
IDT ------ATGGCACAGGTCATTAATACTAATAGTCTGAGTCTGATCACTCAGAATAACATC
LifeTech GCCACCATGGCCCAAGTGATCAACACCAACAGCCTGAGCCTGATCACCCAGAACAACATC
JCAT ------ATGGCCCAGGTGATCAACACCAACAGCCTGAGCCTGATCACCCAGAACAACATC
*****.**.** ** ** ** ** ** ***** ******** ***** ******
IDT AACAAAAACCAATCAGCCCTGTCAAGTTCCATAGAGAGGCTGAGTAGCGGACTGAGGATA
LifeTech AACAAGAACCAGAGCGCCCTGAGCAGCAGCATCGAGAGACTGAGCAGCGGCCTGAGAATC
@hgbrian
hgbrian / gist:e2eac7ea684448519dc6
Last active August 29, 2015 14:05
Flagellin alignment
CLUSTAL O(121) multiple sequence alignment
LifeTech GCCACCATGGCCCAAGTGATCAACACCAACAGCCTGAGCCTGATCACCCAGAACAACATC
Slovenia ------atggcacaagtcattaataccaacagcctctcgctgatcactcaaaataatatc
***** ***** ** ** *********** ******** ** ** ** ***
LifeTech AACAAGAACCAGAGCGCCCTGAGCAGCAGCATCGAGAGACTGAGCAGCGGCCTGAGAATC
Slovenia aacaagaaccagtctgcgctgtcgagttctatcgagcgtctgtcttctggcttgcgtatt
************ ** *** ** ****** * *** *** ** * **
@hgbrian
hgbrian / gist:2cae6189f11375bc1080
Created August 15, 2014 23:30
scrapy for iGEM
# -*- coding: utf-8 -*-
# Run with: scrapy crawl test1 -o test1.json
import scrapy
class IgemItem(scrapy.Item):
year = scrapy.Field()
title = scrapy.Field()
subtitle = scrapy.Field()
description = scrapy.Field()