Skip to content

Instantly share code, notes, and snippets.

View widdowquinn's full-sized avatar

Leighton Pritchard widdowquinn

View GitHub Profile
import seaborn
from itertools import combinations
def is_multiegg(breakfast):
if sum([1 in breakfast, 2 in breakfast, 3 in breakfast]) > 1:
return True
return False
# See Twitter:
@widdowquinn
widdowquinn / github_pages_jekyll_minimal_mistakes.md
Created December 19, 2017 17:56
Create a Jekyll blog on GitHub Pages, using the Minimal-Mistakes Theme

Creating a Jekyll blog on GitHub Pages with Minimal-Mistakes

Setup

First, create a new Jekyll site and corresponding GitHub Pages repository, then test it locally at http://localhost:4000:

$ gem install jekyll bundler
$ jekyll new <REPO>/
Running bundle install in /Users/<USER>/Development/GitHub/<REPO>... 
@widdowquinn
widdowquinn / emacs_python_ide.md
Last active April 27, 2023 17:36
Turning Emacs into a Python IDE

Turning emacs into a Python IDE

## Create a new config/initialisation file

Create a user-level initialisation file init.el:

touch .emacs.d/init.el
@widdowquinn
widdowquinn / jupyterhub_aws.md
Created December 9, 2017 16:33
Set up JupyterHub on AWS

JupyterHub on AWS

EC2 Setup

  • Log in to AWS
  • Go to a sensible region
  • Start a new instance with Ubuntu Trusty (14.04) - compute-optimised instances have a high vCPU:memory ratio, and the lowest-cost CPU time. c4.2xlarge is a decent choice.
  • Set security group (firewall) to have ports 22, 80, and 443 open (SSH, HTTP, HTTPS)
  • If you want a static IP address (for long-running instances) then select Elastic IP for this VM
  • If you want to use HTTPS, you'll probably need a paid certificate, or to use Amazon's Route 53 to get a non-Amazon domain (to avoid region blocking).
@widdowquinn
widdowquinn / restarting_and_upgrading_mediawiki_after_OSX_High_Sierra_upgrade.md
Last active December 9, 2017 16:41
Guide to upgrading and restarting MediaWiki after Sierra -> High Sierra upgrade
@widdowquinn
widdowquinn / kali_osx_persistence_wifi.md
Last active January 28, 2024 06:32
Kali Linux Live USB with persistence and wireless on Macbook Pro

Kali Linux Bootable USB with Persistence and Wireless on OSX

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP. I downloaded the amd64 weekly version, as the pool linux headers (needed below for installation of wireless drivers) were ahead of the stable release kernel.

Download the SHA256SUMS and SHA256SUMS.gpg files from the same location.

@widdowquinn
widdowquinn / gist:f9df8005399431d4aa5c49e9bb7ea0c6
Created May 15, 2017 13:23
Installing `ete3` under Python on OSX in a virtual environment
1) We’re going to do this in a virtual environment, so we don’t pollute the main `Python` installation:
- Change to a suitable clean directory that you can work in
- **YOU NEED TO MAKE SURE THAT THE PATH TO THIS DIRECTORY CONTAINS NO SPACES!** If the path contains spaces, `sip` will fail
- Create a new `Python` virtual environment:
```bash
virtualenv venv-test-ete3 -p python3
```
@widdowquinn
widdowquinn / gist:d61ccc90f7b70b529d7be47f40f93044
Created May 15, 2017 10:46
Install THAPBI-pycits on a bare Linux account
virtualenv venv-THAPBI-pycits -p python2
virtualenv venv-THAPBI-pycits -p python3
source venv-THAPBI-pycits/bin/activate
python2 -m pip install -U pip setuptools
python3 -m pip install -U pip setuptools
python2 -m pip install numpy
python2 -m pip install -r requirements.txt
---
title: "Effect and Sample Size"
author: "Leighton Pritchard"
date: "10 May 2016"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
library(ggplot2)
library(reshape2)
# Load data, and rerank teams by points
data = read.table("SL_points.txt", sep="\t", header=T)
data$old_rank = rank(-data$Old, ties.method="first")
data$bonus_rank = rank(-data$Bonus, ties.method="first")
data$penalty_rank = rank(-data$Penalty, ties.method="first")
# New dataframe of ranked teams under each scheme