Skip to content

Instantly share code, notes, and snippets.

View rymawby's full-sized avatar

Ry Mawby rymawby

View GitHub Profile
@rymawby
rymawby / update-docker-image-using-docker-compose.sh
Created April 19, 2022 04:42
Update docker image using docker compose
// Pull latest version
docker-compose pull
// Stop and remove older version
docker-compose down
// Start the container
docker-compose up -d
@rymawby
rymawby / settings.json
Created February 9, 2022 01:23
Update GitHub copilot suggestion colour for vscode
"workbench.colorCustomizations": {
"editorGhostText.foreground": "#f3aadd",
}
@rymawby
rymawby / fix-raspberry-pi-wifi-dhcpdc-not-running.sh
Created February 2, 2022 00:16
Fix issue where Raspberry Pi not connecting to wifi (dhcpcd not running on reboot)
sudo dhcpcd
source ~/.zshrc
@rymawby
rymawby / xargs-1-line-stdin.sh
Created November 28, 2019 03:21
xargs run 1 line of input at a time rather than all at once
xargs -n1 COMMAND
@rymawby
rymawby / giphy-bash-function.sh
Last active November 22, 2019 03:48
Giphy bash function
function giphy() { curl --silent "https://api.giphy.com/v1/gifs/search?api_key={API_KEY}&limit=1&offset=0&rating=&lang=en&q=$1" | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin')).data[0].images.downsized_large.url" | pbcopy | open -a Slack}
@rymawby
rymawby / run-wist-linter-on-all-files.sh
Created November 18, 2019 03:17
Run wist linter of all ascii Brightscript files
find . -type f -name '*.brs' -exec file --mime {} \; | grep -v 'utf-8\|binary' | sed 's/:.*//' | xargs -P 8 wist
@rymawby
rymawby / install-private-channel.sh
Last active May 17, 2019 00:31
Install private channel on a Roku box
curl -d '' "http://192.168.1.XX:8060/install/CHANNEL_ID"
@rymawby
rymawby / delete-all-local-git-branches-that-match-a-pattern.sh
Created July 11, 2018 05:50
Delete all local git branches that match a pattern
git branch --list 'PATTERN/*' | xargs git branch -d
@rymawby
rymawby / print-all-first-level-properties.brs
Last active February 12, 2017 11:52
Brightscript - print all first level properties of a large associative array
for each a in s
? a "=" s[a]
end for