Skip to content

Instantly share code, notes, and snippets.

View user01's full-sized avatar

Erik Langenborg user01

  • Charlottesville, Virginia
View GitHub Profile
import logging
import logging.config
def logging_configuration():
return {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"long": {
@user01
user01 / cache.py
Created November 17, 2023 02:19
Simple SQLite3 Local cache decorator
# CC0 License
# usage:
# @cache_result("./some_database_path.sqlite")
# def expensive_function():
# pass
import inspect
import logging
import hashlib
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
make \
git \
build-essential \
libssl-dev \
zlib1g-dev \
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y htop curl wget vim tmux parallel speedometer git zsh
sudo chsh -s /bin/zsh
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.bash_aliases > ~/.bash_aliases
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.tmux.conf > ~/.tmux.conf
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.vimrc > ~/.vimrc
sudo curl https://gist.githubusercontent.com/user01/1bc8cc966eda0703ba18c698805ce6ff/raw/65af8e253e786f324e1773092a6d04a9ca9e1d6c/.gitignore > ~/.gitignore
# $HOME/.config/alacritty/alacritty.yml
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
# env:
# # TERM env customization.
# #
@user01
user01 / new_conda_env.sh
Created July 12, 2019 03:58
Link a conda env to Hydrogen in Atom
source activate thisenv
python -m ipykernel install --user --name thisenv
"""Make the custom certificate and private key files used by TLS tests.
Code heavily borrowed from Lib/tests/make_ssl_certs.py in CPython.
"""
import os
import shutil
import tempfile
import subprocess
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y htop curl wget vim tmux parallel speedometer git
git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.bash_aliases > ~/.bash_aliases
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.tmux.conf > ~/.tmux.conf
sudo curl https://gist.githubusercontent.com/user01/ea1937bafe920f66d1455f24e65ee27d/raw/646cf86f912b95098f3a29af99a7bb4d18d437e1/.vimrc > ~/.vimrc
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# -*- coding: utf-8 -*-
# transformations.py
# Copyright (c) 2006-2018, Christoph Gohlke
# Copyright (c) 2006-2018, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: