This file contains 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/osascript -l JavaScript | |
// Usage: | |
// export OLDPASS="oldpasswordhere!" | |
// export NEWPASS="newpasswordgoeshere." | |
// get to change password screen in WorkSpace prior to running this script and make sure you're on the "old password" field. | |
// run script without args | |
var app = Application.currentApplication(); | |
app.includeStandardAdditions = true |
This file contains 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/osascript | |
# Usage: | |
# export OLDPASS="oldpasswordhere!" | |
# export NEWPASS="newpasswordgoeshere." | |
# get to change password screen in WorkSpace prior to running this script and make sure you're on the "old password" field. | |
# run script without args | |
on sysKeyCode(kc) | |
tell application "System Events" to key code {kc} using {command down} |
This file contains 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 safety_preexec() { | |
# Store the command that we're running. | |
CMD_NAME="$1" | |
} | |
function safety_precmd() { | |
if [[ "$CMD_NAME" =~ 'kubectl config use-context whatever-your-prod-is' ]]; then | |
PROD_TIME=$(date +%s) |
This file contains 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" | |
entire contents of process "HipChat" of application "System Events" | |
-- UI elements of process "HipChat" of application "System Events" | |
end tell |
This file contains 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
set myFile to open for access (choose file name) with write permission | |
try | |
repeat | |
tell application "System Events" | |
set frontApp to name of first application process whose frontmost is true | |
if (frontApp = "HipChat") then | |
-- set things to entire contents of group 1 of group 1 of group 1 of window 1 | |
-- set things to UI elements of group 1 of group 1 of group 1 of window 1 |
This file contains 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
# doh this is a keg-only formula. Had to manually link CLI regardless of install method | |
# run these to set up | |
brew tap homebrew/versions | |
brew install homebrew/versions/postgres94 | |
brew services start postgresql@9.4 export | |
# in your shell's RC file: | |
PATH=/usr/local/opt/postgresql@9.4/bin:$PATH | |
LDFLAGS=-L/usr/local/opt/postgresql@9.4/lib | |
CPPFLAGS=-I/usr/local/opt/postgresql@9.4/include |
This file contains 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
package main | |
import ( | |
"encoding/base64" | |
"fmt" | |
"golang.org/x/crypto/sha3" | |
"strings" | |
"time" | |
) |
This file contains 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
# a module included | |
module StubSettings | |
def stub_setting(setting_name, setting_value) | |
allow(Setting).to receive(:[]).with(setting_name).and_return(setting_value) | |
end | |
def stub_setting_assignment | |
allow(Setting).to receive(:[]=) { |setting, value| stub_setting(setting, setting) } | |
end | |
end |
This file contains 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
// From https://en.wikipedia.org/wiki/Indent_style | |
// K & R | |
while (x == y) { | |
something(); | |
somethingelse(); | |
} | |
// 1TBS | |
if (x < 0) { | |
puts("Negative"); |
This file contains 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
0 0 1 * * /opt/letsencrypt/letsencrypt-auto certonly --quiet --standalone --renew-by-default -d example.com >> /var/log/letsencrypt/letsencrypt-auto-update.log |