Skip to content

Instantly share code, notes, and snippets.

@JohnReid
JohnReid / data-science-environment.yml
Created September 10, 2021 20:54
Data science environment
name: DS
channels:
- conda-forge
dependencies:
# System
- pip
# Data science
- numpy
- scipy
@JohnReid
JohnReid / R-script-configuration.R
Last active October 5, 2020 07:58
R script/configuration skeleton
# Minimal/preferred R script environment and configuration
# Packages
library(ggplot2)
library(ggthemes)
library(tidyverse)
# Config
theme_set(theme_few())
scale_colour_discrete <- function(...) scale_colour_few(...)
@JohnReid
JohnReid / setup-Ubuntu.md
Last active September 10, 2021 20:59
Configure a fresh Ubuntu Linux install

Set up a fresh Ubuntu install for development

First update installed packages:

sudo apt upgrade && sudo apt update

Zsh

import setuptools
setuptools.setup(
name='lczero',
version='0.26.0',
author='John Reid',
author_email='johnbaronreid@netscape.net',
description='LC0 chess engine python bindings',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
#!/usr/bin/env python
'''Script to train a bilstm-crf model.'''
import os
import argparse
import random
import numpy as np
import pandas as pd
from sklearn.metrics import f1_score
@JohnReid
JohnReid / nvimCondaEnv.txt
Created October 16, 2019 14:00 — forked from a-yee/nvimCondaEnv.txt
Setting up neovim python3 environment using conda
# bash commands
# lists all of your conda env
conda env list
# Create a conda env w/ python3.5
# -n sets the name for your new env. I call it neovim here
conda create -n neovim python=3.5
# add neovim for python3 to the env
# specify version you want here, 0.1.13 up to date ver atm
@JohnReid
JohnReid / setup.cfg
Last active July 11, 2019 14:34
Default setup.cfg for python projects
[pep8]
# ignore = D203
max-line-length = 120
indent-size = 2
[flake8]
# ignore = D203
max-line-length = 120
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
indent-string = ' '
@JohnReid
JohnReid / beamer.tex
Last active March 4, 2020 21:04
Beamer presentation template
\documentclass[xcolor={usenames, dvipsnames, svgnames, table}]{beamer}
%
% Customise beamer
\usetheme{metropolis} % Simple minimal theme
\usecolortheme[snowy]{owl} % Dark on light
\setbeamertemplate{footline}{} % Completely remove footline
\setbeamertemplate{frametitle continuation}{[\insertcontinuationcount]} % Nicer numbering
%
@JohnReid
JohnReid / letter-template.tex
Created November 19, 2018 16:43
LaTeX letter template
\documentclass{letter}
%
% Compiler specific packages
%
% Check if using XeTeX or not: https://tex.stackexchange.com/a/54597/39498
\usepackage{ifxetex}
\ifxetex{}
\usepackage{fontspec}
\usepackage{csquotes}
\usepackage{polyglossia}
@JohnReid
JohnReid / article.tex
Last active November 12, 2018 17:27
LaTeX article
% Copyright John Reid 2018
%
% A template for LaTeX articles including some boilerplate code I frequently use
% https://gist.github.com/JohnReid/38b744fe9bf7bc25241367e6a894a4bd
%
\documentclass{article}
%
% Compiler specific packages