Skip to content

Instantly share code, notes, and snippets.

Oliver Steele osteele

Block or report user

Report or block osteele

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@osteele
osteele / cask
Created Sep 10, 2019
An abbreviation for `brew cask`, that doesn't require remembering which of `search` and `install` is `brew` vs. `brew cask`
View cask
#!/usr/bin/env bash -eu
# Like `brew cask`, except:
# 1. Shorter
# 2. Doesn't require that I remember which of `search` and `install` is `brew` vs. `brew cask`
if [[ $1 == search ]]; then
brew "$@"
else
brew cask "$@"
@osteele
osteele / chrome-tabs-to-md.sh
Last active Jul 10, 2019 — forked from samyk/chrome_tabs.osa
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
View chrome-tabs-to-md.sh
#!/usr/bin/env bash
# shows all url+titles of Chrome along with front window+tab url+title
# Source: https://gist.github.com/osteele/704d40f90e17d7bc059d06731056bbe7
# Forked from: https://gist.github.com/samyk/65c12468686707b388ec43710430a421
# Original author: https://gist.github.com/samyk
(osascript << EOF
set titleString to ""
tell application "Google Chrome"
@osteele
osteele / README.md
Created Apr 24, 2018
Chris Morgan's bash-for-recording
View README.md

A script bash-for-recording, for invocation by termrec. This does the following:

  • Set the window size to 80×24
  • Set HOME to a new empty directory
  • Set USER and NAME to dummy values (creating an actual new throwaway user account would be better here)
  • Set TERM to xterm-256color
  • Clear the environment (env -i)
  • Set a deliberately very simple and obvious prompt (which sets the title as well)
View gist:19ffce479aff5b67ce224cdd9d7db72e
Verifying my Blockstack ID is secured with the address 13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw https://explorer.blockstack.org/address/13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw
@osteele
osteele / vote-counter.py
Last active Sep 26, 2017
Count the votes in a Liquid Democracy Google Sheet
View vote-counter.py
import pandas as pd
spreadsheet_key = '' # from the Google sheets Publish URL
spreadsheet_range = '' # e.g. B6:E15
url = 'https://docs.google.com/spreadsheets/d/e/{}/pub?gid=0&single=true&output=csv'.format(spreadsheet_key)
if spreadsheet_range:
url += '&range=' + spreadsheet_range
# TODO read this from the doc
@osteele
osteele / find-malicious-conda-env-packages
Created Sep 15, 2017
Report malicious PyPI packages in conda environments
View find-malicious-conda-env-packages
#!/bin/bash
# Report malicious PyPI packages in each conda environment.
# See discussion at https://news.ycombinator.com/item?id=15256121
packages=$(cat <<EOF
acqusition
apidev-coop
bzip
crypt
View SpaceTranslationPatch.py
# SpaceTranslationPatch patches the MacOS Python IDE to convert spaces to tabs
# when a source file is opened, and back to spaces when it's saved.
#
# Drop this file on PythonIDE to install it. It requires
# http://www.strout.net/python/mac/PatchUtils.py in order to run.
#
# Version 2 released to the public domain 3 November 1999
# by Oliver Steele (steele@cs.brandeis.edu).
@osteele
osteele / build_numpy.sh
Created May 30, 2017
Build numpy on macOS
View build_numpy.sh
brew install gcc
pip install nose numpy Tempita
python runtests.py -v
@osteele
osteele / docker-functions.sh
Created Apr 10, 2017
Bash functions for working on an npm package from within Docker
View docker-functions.sh
d.exec () {
docker run \
-v yarn_cache:/root/.cache/yarn \
-v `pwd`:/app \
-v signage_node_modules:/app/node_modules \
-p 3000:3000 \
-it \
node \
"$@"
}
@osteele
osteele / docker-machine-rename
Last active Apr 19, 2017 — forked from alexproca/docker-machine-rename
Rename docker-machine
View docker-machine-rename
#!/usr/bin/env bash -eu
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
# From https://gist.github.com/alexproca/2324c60c86380b59001f
# w/ comments from eurythmia
OLD_MACHINE_NAME=${1:-default};
NEW_MACHINE_NAME=${2:-my-default-2};
You can’t perform that action at this time.