Skip to content

Instantly share code, notes, and snippets.

View jrjhealey's full-sized avatar

Joe Healey jrjhealey

View GitHub Profile
@jrjhealey
jrjhealey / RandomHumanKmers.txt
Created January 21, 2019 18:42
Generating N random kmers from the Human Genome (GRCh38)
# This gist contains 10 randomly selected kmers (9mers) from the reference human genome (GRCh38).
The following code was used to generate the output:
import re, sys
from Bio import SeqIO
import random
import time
k = 9
n = 10
@jrjhealey
jrjhealey / addingusers.sh
Last active February 10, 2020 12:56
Adding Server Users (reminder for myself)
# Step 1
# Add the user with
sudo adduser username
# Ensure a temporary password is given to the account else it remains locked
# other options can be left blank
# Add the username to the AllowedUsers field in /etc/ssh/sshd_config (on the server)
# Next step is often easier to do as the new user to avoid messing up file ownership
sudo -i -u newuser
@jrjhealey
jrjhealey / crop_to_fix.tex
Created June 19, 2019 09:33
A construct to enable, centered, cropped-to-fit content to be generated dynamically. Useful for equations/figures etc. This example uses TeXShade for sequence alignment.
\documentclass[a4paper, oneside, 11pt]{memoir} % Doc Setup
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm]{geometry} % Doc Geometry
\usepackage{texshade}
\usepackage{lscape}
\usepackage[active, tightpage]{preview}
\begin{document}
\begin{landscape}
\begin{preview}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten