This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Configure Python 3.8.0b2 with homebrew tcl-tk and openssl | |
# on macOS Catalina public beta with Xcode 11 beta 4 | |
# Installs to ~/local. | |
set -e -u | |
brew update | |
brew install openssl tcl-tk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# I finally read the documentation for socket.sendmsg, and there it | |
# was: How to send a list of file descriptors over an AF_UNIX socket: | |
# https://docs.python.org/3/library/socket.html?highlight=sendmsg#socket.socket.sendmsg | |
# https://docs.python.org/3/library/socket.html?highlight=sendmsg#socket.socket.recvmsg | |
import array | |
import socket | |
import typing as tp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Open Automator | |
# File -> New | |
# Select "Print Plugin" | |
# In the resulting document: | |
# Drag Run Shell Script to the right-hand pane | |
# Set shell to /bin/zsh | |
# Paste in this script | |
filename=$(basename "$1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Many thanks to | |
# https://gist.githubusercontent.com/elliewhatever/adbe3fba37d747fb8b04af8f835d46d2/raw/61e2bd530eb434f7ea2f595262e1922cdd057f7c/PySide6.sh | |
# Assumes brew and python are installed | |
brew install qt@6 llvm cmake ninja git | |
# Setup environment relative to current directory - | |
# this eases building in an existing Python venv. | |
mkdir -p ./.pyside6; cd ./.pyside6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
import sys | |
import sysconfig | |
from PySide6.QtCore import QCoreApplication | |
from PySide6.QtWidgets import QApplication | |
from .main_win import MainWin | |
def main() -> int: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
data = pd.read_csv("data/cu.data.1.AllItems.txt", sep=r"[ \t]+", engine="python") | |
# Get 'All items in U.S. city average, all urban consumers, seasonally adjusted' | |
overall = data[data["series_id"] == "CUSR0000SA0"] | |
# NB: pct_change() computes fractional change. |