This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GL_TOKEN=xxxxxxx-xxxxxxx | |
| ID_FROM=00001 | |
| ID_DESTINATION=00002 | |
| PREFIX= | |
| [ "$1" == "--dry-run" ] && PREFIX=echo | |
| download_page () { | |
| DATA=`curl --header "PRIVATE-TOKEN: $GL_TOKEN" "https://gitlab.com/api/v4/projects/$ID_FROM/variables?per_page=100&page=$c"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Credits: https://superuser.com/a/937488/44834 | |
| -- https://apple.stackexchange.com/a/346995/62041 | |
| set inputVolume to input volume of (get volume settings) | |
| -- Zoom does not allow the input volume to drop to 0, so we check by "lower than" | |
| if inputVolume < 10 then | |
| set inputVolume to 100 | |
| set displayNotification to "Microphone Unmuted" | |
| else | |
| set inputVolume to 0 | |
| set displayNotification to "Microphone Muted" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function services() { | |
| brew services \ | |
| `echo -e 'list\nstart\nstop' | fzf --header 'brew services'` \ | |
| `brew services list | tail -n +2 | \ | |
| fzf -d' ' --with-nth=1 --preview='brew services list | grep {}' --preview-window=up:1 | \ | |
| cut -d' ' -f1` | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| const fs = require('fs') | |
| const FILE = './bulk.csv'; | |
| const data = fs.readFileSync(FILE, 'utf8'); | |
| console.log('bytes', data.length) | |
| const lines = data.split('\n'); | |
| console.log('lines', lines.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/bash | |
| # Prerequisites: | |
| # mkdir gcalcli-local && cd !$ | |
| # pip3 install virtualenv | |
| # virtualenv venv | |
| # source venv/bin/activate | |
| # pip3 install gcalcli | |
| # which gcalcli # use this as command path in this script below | |
| # deactivate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # prerequisites: brew install fzf hub | |
| function prss() { | |
| hub issue --include-pulls --color \ | |
| --since=`date -u -v-1m +"%Y-%m-%dT%H:%M:%SZ"` \ | |
| --format="%Cyellow%i%Creset %t %Cwhite@%au%Creset %l %Cyellow%cr%Creset%n" | \ | |
| fzf --ansi --preview="echo {} | cut -d' ' -f1 | tr -d '#' | xargs -I % hub issue show %" | \ | |
| cut -d' ' -f1 | tr -d '#' | \ | |
| xargs -I {} sh -c 'git rev-parse --verify pr-{} || git fetch origin pull/{}/head:pr-{} && git checkout pr-{}' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tell application "System Events" to tell process "zoom.us" | |
| tell window 1 | |
| set buttonTitle to description of button 1 | |
| # needs "Window > Always show meetings controls" enabled | |
| if buttonTitle = "Unmute My Audio" then | |
| click button 1 | |
| "unmuted" | |
| else if buttonTitle = "Mute My Audio" then | |
| click button 1 | |
| "muted" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Source: https://macscripter.net/viewtopic.php?pid=189593#p189593 | |
| # example: inspecting the contents of the Notes window | |
| tell application "System Events" to tell process "Notes" | |
| class of UI elements | |
| tell window 1 | |
| class of UI elements | |
| tell splitter group 1 | |
| class of UI elements | |
| # get name of button 1 | |
| tell splitter group 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mrs() { | |
| [ -z "$GITLAB_TOKEN" ] && \ | |
| echo 'Missing GITLAB_TOKEN env var. See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token' && \ | |
| return 1 | |
| # download from GL API, process with jq and colorize with sed replace | |
| curl https://gitlab.com/api/v4/merge_requests?private_token=$GITLAB_TOKEN\&state=opened\&sort=desc\&scope=assigned_to_me 2>/dev/null | \ | |
| jq --raw-output '.[] | "#" + (.iid | tostring) + " " + .title + " @" + .author.username + " | " + (.labels | join(", ")) + " \n 👉 " + .web_url + "\n"' | \ | |
| sed "s,.*https.*,$(tput setaf 6)&$(tput sgr0)," | \ | |
| sed -e "s/\(#[0-9]*\)\(.*\)\(@[a-zA-Z0-9-]*\) |\(.*\)/$(tput setaf 220)\1$(tput sgr0)\2$(tput setaf 7)\3 $(tput setab 4)\4$(tput sgr0)/g" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function staging() { | |
| echo -e "\e[2m\$ heroku $@ -a heroku-staging-app\e[0m" | |
| heroku $@ -a heroku-staging-app | |
| } | |
| function prod() { | |
| echo -e "\e[2m\$ heroku $@ -a heroku-production-app\e[0m" | |
| heroku $@ -a heroku-production-app | |
| } | |
| alias prapps='heroku pipelines:info heroku-pipeline | grep review' | |
| function prapp (){ |