Skip to content

Instantly share code, notes, and snippets.

View mcfitzgerald's full-sized avatar

Michael Fitzgerald mcfitzgerald

View GitHub Profile
@mcfitzgerald
mcfitzgerald / mcf_plotly_theme.py
Created July 10, 2022 18:51
Plotly theme that looks more like standard R plots
import plotly.graph_objects as go
import plotly.io as pio
pio.templates["mike"] = go.layout.Template(
{
"data": {
"histogram2dcontour": [
{
"type": "histogram2dcontour",
"colorbar": {
@mcfitzgerald
mcfitzgerald / shell_voodoo.md
Last active March 13, 2021 21:44
Useful shell commands

Find a previously entered command:

history | grep [command fragment]

and load it on prompt:

![history number]


@mcfitzgerald
mcfitzgerald / keyboard_shortcus.md
Last active March 13, 2021 21:35
Useful Keyboard Shortcus

A cheat sheet for various keyboard shortcuts


OS X

Switch active window:

ctrl-`

@mcfitzgerald
mcfitzgerald / selenium_scroll.py
Last active February 10, 2021 13:01
Infinite scroll and extract with Selenium
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# set up driver options
options = Options()
options.add_argument("--headless")
def scroll(driver, timeout):
# munged from a handful of google searches
@mcfitzgerald
mcfitzgerald / python-gitignore
Created December 3, 2020 23:03
Sane Python gitignore
# PyPoetry
pyproject.toml
poetry.lock
# VS Code
.vscode
# Environments
.env
.venv
@mcfitzgerald
mcfitzgerald / config-5.5.3
Created August 26, 2020 20:17
Linux From Scratch - (Kernel Version 5.5.3) - Configuration For Google Cloud VM
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.5.3 Kernel Configuration
#
#
# Compiler: gcc (GCC) 9.2.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90200
@mcfitzgerald
mcfitzgerald / create_vm.gcloud
Last active August 8, 2020 20:10
Create Google Cloud VM with attached disk.
gcloud compute instances create [INSTANCE-NAME] --zone=[ZONE] \
--metadata=^,@^serial-port-enable=true \
--image=debian-10-buster-v20200805 \
--image-project=debian-cloud \
--boot-disk-size=200GB \
--create-disk=mode=rw,auto-delete=yes,size=200,name=[DISK-NAME],device-name=[DISK-NAME]