Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Guy Pursey guypursey

🏠
Working from home
View GitHub Profile
@guypursey
guypursey / git-global-config.sh
Created December 5, 2022 15:15
Helpful Git aliases
View git-global-config.sh
git config --global alias.alias "config --get-regexp ^alias\."
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.inked "log --color=always --pretty=format:'A:%Cgreen%ad%Creset %h %Cred%cd %C(brightblue white)%D%Creset %s' --date=format:'%Y/%m/%d@%H%M' --decorate=short --decorate-refs=tags --author-date-order"
git config --global alias.keyed "log --color=always --pretty=format:'C:%Cred%cd%Creset %h %Cgreen%ad %C(brightblue white)%D%Creset %s' --date=format:'%Y/%m/%d@%H%M' --decorate=short --decorate-refs=tags --date-order"
@guypursey
guypursey / git-add-atomic.sh
Last active September 29, 2019 10:04
git-add-atomic
View git-add-atomic.sh
#!/bin/bash
# diff a specific file for now (check it exists, etc.)
# extract hunk texts
bold=$(tput bold)
head=$(tput smul)
oldd=$(tput setaf 1)
newd=$(tput setaf 2)
askq=$(tput setaf 5)
@guypursey
guypursey / test-link-data.json
Last active April 16, 2019 11:17
Test link data
View test-link-data.json
@guypursey
guypursey / for-console.js
Last active November 30, 2017 16:39
Way of extracting data as TSV from Trello
View for-console.js
members = JSON.parse(document.getElementsByTagName("pre")[0].innerHTML).members
.reduce((p, c) => { p[c.id] = c.fullName; return p }, {})
lists = JSON.parse(document.getElementsByTagName("pre")[0].innerHTML).lists
//.filter(x => !x.closed)
.reduce((p, c) => { p[c.id] = c.name; return p }, {})
labels = JSON.parse(document.getElementsByTagName("pre")[0].innerHTML).labels
.reduce((p, c) => { p[c.id] = c.name; return p }, {})
@guypursey
guypursey / .block
Last active October 1, 2017 17:28
Test coverage visualisation (demo with D3 v4)
View .block
license: mit
scrolling: yes
@guypursey
guypursey / .block
Last active September 18, 2017 20:57
Co-occurrence matrix as wheel (University of Reading joint degree options 2014 data) with D3 v4
View .block
license: mit
@guypursey
guypursey / .block
Last active September 2, 2017 14:04
Co-occurrence matrix (University of Reading joint degree options 2014 data) with D3 v4
View .block
license: mit
@guypursey
guypursey / .block
Last active September 21, 2023 09:51 — forked from mbostock/.block
Wrapping long labels with D3 v4 (sample data)
View .block
license: gpl-3.0
@guypursey
guypursey / .block
Last active July 29, 2017 10:43
UK General Election 2017 FT-style slopegraph (D3 v4)
View .block
license: mit
@guypursey
guypursey / README.md
Last active June 26, 2017 18:35
UK General Election 2017 Financial Times data scrape
View README.md