Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Yates andrewyates

View GitHub Profile
@andrewyates
andrewyates / conda-tutorial.md
Created Oct 13, 2020
Guide to installing Python with Conda
View conda-tutorial.md

Installing Python 3 via Conda

This tutorial describes how to install Python 3 into your home directory using the Conda package manager. We'll use the Miniconda variant, which is just Anaconda with fewer packages installed by default.

  1. Download: wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh
  2. Make executable: chmod +x Miniconda3-py37_4.8.3-Linux-x86_64.sh
  3. Run installer: ./Miniconda3-py37_4.8.3-Linux-x86_64.sh When prompted, say yes when asked if you want to initialize Miniconda.
  4. Close and re-open your shell in order for the installation to take effect. (e.g., close your terminal or SSH connection and then re-open)
@andrewyates
andrewyates / rmxiv.py
Last active Mar 29, 2018
Downloads arxiv papers and adds them to reMarkable's cloud storage. Requires https://github.com/lukasschwab/arxiv.py and https://github.com/juruen/rmapi
View rmxiv.py
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE
import arxiv
def download_paper(url, outdir="/home/andrew/.arxiv/"):
if not os.path.exists(outdir):
View context_snippet.py
def avg_vec(terms):
vecs = [word2vec_model[term] for term in terms if term in word2vec_model]
if len(vecs) == 0:
print("WARNING: sequence of UNKs")
return np.zeros(word2vec_model.vector_size)
else:
return unitvec(np.mean(vecs, axis=0))
os.mkdir(context_outdir)
qid_contexts = {}
@andrewyates
andrewyates / gist:f988fa8c69ce8503d2b0
Created Mar 11, 2015
set the screen window title to the currently running (or last run) command
View gist:f988fa8c69ce8503d2b0
# set the screen window title to the currently running (or last run) command
preexec () {
local CMD=${1[(wr)^(*=*|sudo|-*)]}
print -Pn "\ek$CMD $a\e\\"
}
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewyates on github.
  • I am andrewyates (https://keybase.io/andrewyates) on keybase.
  • I have a public key whose fingerprint is 1765 4D54 3003 9503 FAA9 4095 6F4F FCDD 6B40 34AA

To claim this, I am signing this object:

@andrewyates
andrewyates / ggplot-light.rc
Created Feb 1, 2014
ggplot-light style for mpltools
View ggplot-light.rc
# modified ggplot style with a white background
# from https://github.com/tonysyu/mpltools/blob/master/mpltools/style/ggplot.rc
# which was based on http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
patch.linewidth = 0.5
patch.facecolor = '#348ABD' # blue
patch.edgecolor = '#EEEEEE'
patch.antialiased = True
font.size = 14.0