Skip to content

Instantly share code, notes, and snippets.

bellerbrock /
Created May 12, 2023 16:05 — forked from bryanbraun/
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with (formerly
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below):
  4. Customize as needed for your team.

UPDATE nd_experiment
SET nd_geolocation_id = 119
WHERE nd_geolocation_id = 52;
UPDATE projectprop
SET value = '119'
WHERE value = '52'
AND type_id = (
# Retrieve NCSU crosses that are missing female_parent stock_relationship
SELECT stock.stock_id, stock.uniquename FROM stock
LEFT JOIN stock_relationship sr ON(
stock.stock_id = sr.object_id
AND sr.type_id = (SELECT cvterm_id FROM cvterm WHERE name = 'female_parent')
JOIN nd_experiment_stock s ON(stock.stock_id = s.stock_id)
JOIN nd_experiment_project p ON(s.nd_experiment_id = p.nd_experiment_id)
JOIN project t ON(p.project_id = t.project_id)
JOIN project_relationship pr ON(
bellerbrock / gist:156ef0af4eed2a023b973d32212292af
Last active January 15, 2020 18:36
Handy breedbase db migration commands
# skips first sp_person_id to exclude admin account
psql -U postgres -h breedbase_db <db_name> -c "\copy (SELECT * FROM sgn_people.sp_person where sp_person_id > 1) TO STDOUT" > people.tsv
psql -U postgres -h breedbase_db <db_name> -c "COPY sgn_people.sp_person FROM STDIN" < people.tsv
# Grant usage on all schemas to web_usr
DO $do$
sch text;
FOR sch IN SELECT nspname FROM pg_namespace
license: gpl-3.0
bellerbrock / gist:2248f83417fb71ca712fa10025a33bee
Last active December 6, 2019 16:59
Sending confirmation emails via SMTP

Notes about confirmation email troubleshooting.

Confirmation emails sent with the local hostname go to spam, and Mail::Sendmail does seem to support SMTP auth very well. I could not get Mail::Sendmail to work with I also had no luck with Email::Sender::Transport::SMTP which is already a dependency, or Email::Sender::Transport::SMTPS

The best soultion I've found is Email::Send::SMTP::Gmail which works well and has bonus features like support for file attachments. To use it, install it (cpanm Email::Send::SMTP::Gmail) and make sure the gmail account being used for login has the 'allow access for less secure apps' setting turned on.

Here's a test script for proof of concept:

bellerbrock / Enable logging in RTT
Last active March 19, 2020 16:20
Enable logging in RTT
# Add to beginning of cgi:
import logging
import pprint
import config
pp = pprint.PrettyPrinter(indent=4)
logging.basicConfig(filename=config.ROOT_PATH+"/rtt.log", level=logging.DEBUG)
# Add debugging print statements like this
bellerbrock / new_system_config.txt
Last active October 17, 2019 20:16
New system configuration
Install Rstudio
Install Peek
Install VirtualBox
Install Android Studio
sudo apt install
sudo apt install htop
Setup .bash_aliases
bellerbrock / sgn_local.conf
Created October 16, 2019 20:52
Default example of sgn_local.conf
dbhost breedbase-db
dbname breedbase
dbuser postgres
dbpass postgres
rootpath /home/production/cxgn
basepath /home/production/cxgn/sgn
composable_cvs trait,toy
composable_cvs_allowed_combinations Time Series|trait+toy
bellerbrock / bash_aliases.txt
Last active October 17, 2019 20:42
Handy general aliases and for working with breedbase docker containers
alias log='tail -f -n 100 /var/log/sgn/error.log'
#docker commands
alias drm='docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker image rm $(docker images) && docker volume rm $(docker volume ls)' # && docker ps -a && docker images && docker volume ls'
alias dps='docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"'
alias dpsa='docker ps -a'
alias dstart='docker start $(docker ps -qa)'
alias dstop='docker stop $(docker ps -qa)'