Skip to content

Instantly share code, notes, and snippets.

View danielecook's full-sized avatar
😀
Things are going good

Daniel E Cook danielecook

😀
Things are going good
View GitHub Profile
@danielecook
danielecook / fastq_headers.sh
Last active February 11, 2019 16:04
Extract all FASTQ headers
IFS=$'\n'
for line in `cat fastq_list.tsv`; do
zcat $line | head -n 1 | awk -v fname=$line -v OFS="\t" '{ print $0, fname}' >> fastq_headers.tsv
done
wget -r --no-parent --reject ".*" ftp://[email protected]/bundle/hg19/
@danielecook
danielecook / updown.json
Last active June 6, 2019 11:29
Sublime text jump lines
[
{ "keys": ["command+down"], "command": "plus_line", "args": {"lines": 10}},
{ "keys": ["command+up"], "command": "minus_line", "args": {"lines": 10}},
]
@danielecook
danielecook / gist:f6a6851f6b09f4b67261054b2b198ccf
Created December 6, 2018 16:45
BamSurgeon Conda Environment
name: bamsurgeon
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- python=2.7
- bwa=0.7.17
- picard==2.9.2
- velvet==1.2.10
@danielecook
danielecook / unnest.py
Last active December 11, 2019 23:43
unnest pandas df
# https://benjcunningham.org/blog/unnest-list-columns-in-pandas.html
import pandas as pd
def unnest(df, col):
unnested = (df.apply(lambda x: pd.Series(x[col]), axis=1)
.stack()
.reset_index(level=1, drop=True))
unnested.name = col
return df.drop(col, axis=1).join(unnested)
@danielecook
danielecook / strava_bitbar.go
Last active June 26, 2019 19:21
strava bitbar plugin
package main
/*
# <bitbar.title>Strava</bitbar.title>
# <bitbar.version>v0.0.1</bitbar.version>
# <bitbar.author>Daniel Cook</bitbar.author>
# <bitbar.author.github>danielecook</bitbar.author.github>
# <bitbar.desc>Bitbar Strava tracker</bitbar.desc>
*/
@danielecook
danielecook / log.sql
Last active August 22, 2018 02:05
Enable logging in mysql
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log_file = "/Users/dancook/Documents/snippet-q/snippet-q/mysql.log";
SET GLOBAL log_output = 'FILE';
@danielecook
danielecook / stocks.py
Created July 12, 2018 14:14
Fetch stock company summary from YAHOO Finance
import html
import requests
from bs4 import BeautifulSoup
def boolify(s):
if s == 'True':
return True
if s == 'False':
return False
raise ValueError("huh?")
@danielecook
danielecook / packages
Last active June 21, 2018 11:54
preferences.sublime-settings
✔ Alignment | ✔ Anaconda
✔ ayu | ✔ Color Highlighter
✔ Gist | ✔ Git
✔ GitGutter | ✔ Jinja2
✔ LESS | ✔ MarkdownEditing
✔ Package Control | ✔ PackagesUI
✔ Pretty JSON | ✔ Python 3
✔ Python Improved | ✔ rainbow_csv
✔ Se
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
sudo /usr/libexec/locate.updatedb