Skip to content

Instantly share code, notes, and snippets.

@kylebarlow
kylebarlow / FanGraphs script for Yahoo leagues.user.js
Last active April 2, 2024 17:56
Greasemonkey/tampermonkety user script to highlight your league and team's taken players when viewing fangraph pages
// ==UserScript==
// @name FanGraphs Script for Yahoo Leagues
// @include https://fantasy.fangraphs.com/*
// @include https://www.fangraphs.com/*
// @version 1.1
// @grant GM.xmlHttpRequest
// ==/UserScript==
// Created 4/1/2021 u/jackries
// Updated April 2024 by KB
@kylebarlow
kylebarlow / generate_limited_rotamer_set.py
Last active March 12, 2023 11:37
Python script using openbabel to generate 3d conformers for a small molecule for a limited subset of atoms
# Copyright (c) 2016 Kyle Barlow
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
@kylebarlow
kylebarlow / gist:58717ade658c344317e3
Created September 8, 2014 20:26
Javascript code to make random groups of students
<p>Fill out below form to make a random group of first-year friends.</p>
<FORM xmlns="http://www.w3.org/1999/xhtml" NAME="groupform" ACTION="" METHOD="GET">
Enter number of groups/desired group size: <BR>
<INPUT TYPE="text" name="groupNum">
<P>
<INPUT TYPE="button" NAME="makeGroupNum" Value="Make above number of groups" onClick="makeGroupNum(this.form)">
<INPUT TYPE="button" NAME="makeGroupSIze" Value="Optimize for above group size" onClick="makeGroupSize(this.form)">
</FORM>
def make_weblogo(input_seqs, title, resolution, file_format = 'png', add_n = True, labels = None):
seqs = weblogo.seq.SeqList( alphabet = weblogo.seq.unambiguous_protein_alphabet )
seq_len = None
for seq in input_seqs: if seq_len == None: seq_len = len(seq) else: assert( seq_len == len(seq) ) seqs.append(seq)
import pandas as pd
def get_mutant_part_of_string(s):
return s.split()[1][-1]
df = pd.read_csv('/home/kyle/Downloads/uby_1ubq.tsv', sep='\t')
print df.head()
df.loc[:,'mut_aa'] = pd.Series(df['Mutation'].apply(get_mutant_part_of_string), index=df.index)
print df.head()

Keybase proof

I hereby claim:

  • I am kylebarlow on github.
  • I am kylebarlow (https://keybase.io/kylebarlow) on keybase.
  • I have a public key ASCzZSqnJF76vdYo-mbErVUnqU8kGS-8keXsLkyoK7yJCQo

To claim this, I am signing this object:

@kylebarlow
kylebarlow / gist:5665584
Created May 28, 2013 19:52
Script to plot gender roadtrip data that I generated. Used for my post on Beaker Report: http://www.beakerreport.com/2013/05/28/genderdriving/
#!/usr/bin/python
'''
Script to plot gender roadtrip data using matplotlib
'''
__author__ = "Kyle Barlow"
__email__ = "kb@kylebarlow.com"
__license__ = "GPL v3"