Badly Designed Bike Racks

🔖 cycling 
Yesterday I came across what is quite possibly the most badly designed bike rack I have ever seen. May I present to you: the Capitol Bike Rack by Forms+Surfaces. Image credit https://www.forms-surfaces.com/capitol-bike-rack There were two of these side by side and at first it wasn’t even clear to me that they were supposed to be bike racks (none of them were occupied, of course). Luckily they have a nice bike symbol stamped on them that eased my uncertainty, but not my doubts. Read more...

Passwordstore (pass) extremely slow on OSX

🔖 code 
passwordstore (installed via homebrew) on OSX is very slow. Austins-MacBook% time pass testpass thisisatestpass pass testpass 0.55s user 0.25s system 83% cpu 0.969 total Over half a second to print out a password. Pass is just a bash script. This would not do. After doing some sleuthing, it turns out it is this line in the platform specific code for OSX that is causing the problem: GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" Every time pass is run on OSX, it first has to run homebrew to find out where gnu-getopt is installed. Read more...

Does Strava Encourage Illegal Trail Riding?

🔖 cycling 
I recently received the following email in my Trail Care inbox (names and locations removed): Hi, I am a long time mtb rider. I am also on the Board of Directors for the local open space advocacy/trails stewardship group. The actual owner of the surrounding open space is the county. Like other areas, we have a ton illegal trails. Many of the authorities see Strava as a negative in that riders publicly post their illegal trail rides which leads others to follow. Read more...

Reliable California Wildfire Information

🔖 other 

November is wildfire season in California, and this year has been no exception. Just when we thought it couldn’t get worse than 2017 / 2018, it did.

Unfortunately it can be super hard to get good information about wildfires while they are happening. This is mainly due to every local news station eagerly exploiting tragedy for readership. Googling a fire returns pages of poorly and hastily written articles that contain, at best, out of date information (but plenty of shocking cell phone video) and at worst no information at all.

Read more...

Simple Virtualenv Auto Activation With ZSH.

🔖 linux 

Since I moved from fish to zsh, one of the main things I missed was virtualfish. I’m not sure how any serious python developer lives without auto activation, as in automatically activating the virtualenv for your project when you open a terminal or cd to it.

Here is a script you can use to achieve auto activation. It doesn’t require virtualenvwrapper, pyenv, or anything like that. Just use python3’s built in python -m venv to create a virtualenv in ~/.virtualenvs/, use the provived venvconnect function to connect the activated env with the current directory, and you’re done.

#!/bin/zsh
#
# Auto activate a python virtualenv when entering the project directory.
# Installation:
#   source virtualenv-auto-activate.sh
#
# Usage:
#   Function `venvconnect`:
#       Connect the currently activated virtualenv to the current directory.
#
VENV_HOME=$HOME/.virtualenvs

function _virtualenv_auto_activate() {
    if [[ -f ".venv" ]]; then
        _VENV_PATH=$VENV_HOME/$(cat .venv)

        # Check to see if already activated to avoid redundant activating
        if [[ "$VIRTUAL_ENV" != $_VENV_PATH ]]; then
            source $_VENV_PATH/bin/activate
        fi
    fi
}

function venvconnect (){
    if [[ -n $VIRTUAL_ENV ]]; then
        echo $(basename $VIRTUAL_ENV) > .venv
    else
        echo "Activate a virtualenv first"
    fi
}

chpwd_functions+=(_virtualenv_auto_activate)
precmd_functions=(_virtualenv_auto_activate $precmd_functions)

Source the above script in your ~/.zshrc and you should get auto activation of python virtualenvs.

A Piece of Trash a Day

🔖 earth  other 

The lines we make in our day to day lives. Placed on a heatmap of all our motion, our daily routines show up in blazing hot purple. We ride down the same streets on our way to work, walk the same sidewalks to get the groceries, wander familiar shorelines on sunset strolls.

Read more...

Customizing grml-zsh-config

🔖 linux 

Ever heard of grml-zsh-config? Maybe not, but it’s possible you may have used it. It’s the zsh config for the Arch linux installer, as well as some Debian systems.

Grml is a nice alternative to heavy and bloated config frameworks like oh-my-zsh and pretzo (even on a modern machine I’ve seen zsh take over a second to load using oh-my-zsh with just a few plugins enabled).

Unfortunately, grml is not that easy to configure, and the available documentation is a little lacking. With a few tweaks though, I managed to get a proper shell out of grml.

Read more...