Skip to content

Instantly share code, notes, and snippets.

View bbarad's full-sized avatar

Benjamin Barad bbarad

View GitHub Profile
@irisdyoung
irisdyoung / select_differing_residues.md
Last active March 10, 2020 15:29
Jiffy script to tell you the positions of residues

snippet for selecting only differing residues based on an alignment: run the one-liner below on a file “seq” containing the alignment lines only, with all newline characters removed:

export j=0; cat seq | while read -n 1 char; do export j=$((j+1)); if [ "$char" != "*" ]; then echo -n "${j},"; fi; done; echo

in pseudocode, that's:

  1. set up a counter starting at 0

  2. feed me the contents of a file called "seq"

@bjmiller121
bjmiller121 / multiple-push-urls.md
Last active October 23, 2024 22:13
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@csmpls
csmpls / i3config
Last active August 29, 2015 14:03
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@CamDavidsonPilon
CamDavidsonPilon / 538.json
Last active November 28, 2021 07:37
Use the two files below to mimic graphs on 538. www.dataorigami.net/blogs/fivethirtyeight-mpl
{
"lines.linewidth": 2.0,
"examples.download": true,
"patch.linewidth": 0.5,
"legend.fancybox": true,
"axes.color_cycle": [
"#30a2da",
"#fc4f30",
"#e5ae38",
"#6d904f",
@maximebf
maximebf / webtail.py
Created October 21, 2011 13:25
Web tail / tail -f as a webpage using websocket
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver