Skip to content

Instantly share code, notes, and snippets.

View davipatti's full-sized avatar

David Pattinson davipatti

  • UW-Madison
  • New York, USA
View GitHub Profile
@davipatti
davipatti / stdout
Created April 27, 2020 15:48
lc0 build fail
david@puck~/D/lc0> ./build.sh
~/Downloads/lc0 ~/Downloads/lc0
The Meson build system
Version: 0.51.2
Source dir: /home/david/Downloads/lc0
Build dir: /home/david/Downloads/lc0/build/release
Build type: native build
Project name: lc0
Project version: undefined
C++ compiler for the host machine: ccache c++ (gcc 9.2.1 "c++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008")
@davipatti
davipatti / mpl-int-grid.py
Created April 23, 2020 18:52
Matplotlib integer spaced grid
import matplotlib as mpl
import matplotlib.pyplot as plt
ax = plt.gca()
ax.get_xaxis().set_major_locator(mpl.ticker.MultipleLocator(base=1.0))
ax.get_yaxis().set_major_locator(mpl.ticker.MultipleLocator(base=1.0))
@davipatti
davipatti / nbdata raw
Created April 23, 2020 15:31
pelican nbdata ipynb fields
- title:
- author: David Pattinson
- date: 2020-04-23
- summary:
- tags:
- category: ipynb
@davipatti
davipatti / stderr
Last active April 10, 2020 21:19
pip install mdtraj stdout and stderr
ERROR: Command errored out with exit status 1:
command: $HOME/.virtualenvs/mdtraj-env/bin/python3 $HOME/.virtualenvs/mdtraj-env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpxutcdirh
cwd: /tmp/pip-install-zh6bw7x_/mdtraj
Complete output (649 lines):
Using built-in specs.
COLLECT_GCC=x86_64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
david@puck~/Downloads> scp acorg:/syn/eu/R/acmacs.r_3.6_R_x86_64-pc-linux-gnu.tar.gz .
acmacs.r_3.6_R_x86_64-pc-linux-gnu.tar.gz 100% 22MB 437.6KB/s 00:52
david@puck~/Downloads> R
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
language: python
python:
- "3.6"
install:
- "pip install -e ."
script:
- test/test.py
#!/bin/bash
# wc-timeseries.sh
# Plot word count over time for a latex project under git version control.
# Iterate over git commits
# Append date, word count and commit sha1 to a csv file
echo date,count,sha1 > /tmp/wc-timeseries.csv
for line in $(git log --decorate=no --reverse --format="format:%H,%aI")
do
@davipatti
davipatti / djp.mplstyle
Created May 29, 2019 15:58
My custom matplotlib style configuration
# Based on https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/mpl-data/stylelib/seaborn-whitegrid.mplstyle
axes.axisbelow: True
axes.edgecolor: .8
axes.facecolor: white
axes.grid: True
axes.labelcolor: .15
axes.linewidth: 1
figure.facecolor: white
figure.figsize : 7, 4.32
font.family: sans-serif
#!/bin/bash
# Toggle gsettings (ubuntu GNOME desktop) night light
state=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled)
case $state in
true )
new=false
;;
false )
new=true
;;
#!/usr/bin/env python
import argparse
import RPi.GPIO as GPIO
import time
# Parse command line arguments
parser = argparse.ArgumentParser(description="Water the field.")
parser.add_argument("--minutes", dest="minutes", help="How long to water for.")
args = parser.parse_args()