Skip to content

Instantly share code, notes, and snippets.

View annarailton's full-sized avatar

Anna Railton annarailton

View GitHub Profile
default_language_version:
python: python3.7
default_stages: [commit, push]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
@annarailton
annarailton / headphones.sh
Created July 9, 2019 07:37
A2DP sink on bluetooth headphones + Ubuntu
# Hack job script to get correct audio profile on my bluetooth headphones
# Replace DEVICE_ID with your device's ID
# From https://askubuntu.com/a/773391
DEVICE_ID="04:5D:4B:DE:CF:8E"
pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` off; sleep 2 ; echo -e "disconnect $DEVICE_ID\n quit"|bluetoothctl;sleep 5; echo -e "connect $DEVICE_ID\n quit"|bluetoothctl; sleep 5; pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` a2dp_sink
@annarailton
annarailton / .inputrc
Last active July 12, 2019 21:06
Config that allows history search
# May need to do
# $ bind -f ~/.inputrc
# to get these to work
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
# In yapf >0.27.0, behaviour of default behaviour around SPLIT_BEFORE_FIRST_ARGUMENT
# changed. This overrides this. Put in top level of your directory with
# .pre-commit-config.yml file.
[style]
based_on_style = pep8
split_before_first_argument = True
@annarailton
annarailton / check-commit-messages.yml
Last active December 28, 2020 22:22
GitHub Action that checks PRs for commits with messages containing `fixup!` and `squash!`
name: PR commit checker
on: pull_request
jobs:
get-commits:
runs-on: ubuntu-latest
steps:
- name: Get PR commits
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o out.json ${{ github.event.pull_request.commits_url }}