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
import boto3 | |
from datetime import datetime, timedelta | |
region = 'us-east-1' | |
cloudwatch = boto3.client( 'cloudwatch', region_name=region ) | |
def lambda_handler( event, context ): | |
today = datetime.now() + timedelta( days=1 ) # today + 1 because we want all of today | |
two_weeks_ago = today - timedelta( days=14 ) | |
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
all: | |
rebuild: | |
make distclean && make clean && make CMAKE_BUILD_TYPE=Release | |
sudo make install | |
pip2 install --user --upgrade neovim | |
pip3 install --user --upgrade neovim | |
gem update neovim |
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
# convert *.xlsx to *.xlsx.csv using https://github.com/dilshod/xlsx2csv | |
pip install xlsx2csv | |
# (shell-fu from http://stackoverflow.com/a/12965604) | |
find . -iname "*.xlsx" -exec sh -c 'xlsx2csv "$1" > "$1.csv"' x {} \; | |
# grep .csv files | |
brew install ripgrep | |
rg -i -g "*.csv" "waldo" | |
# ...or plain ole grep |
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
on alfred_script(q) | |
tell application "iTerm2" | |
activate | |
tell current window | |
create tab with default profile | |
select | |
tell current session | |
write text q | |
end tell | |
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 theProcessName to "Safari" | |
set theWindowNumber to 1 | |
tell application "System Events" | |
tell process theProcessName | |
activate | |
tell window theWindowNumber | |
set thePosition to position | |
set theSize to size | |
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
test { | |
// Log failures in an error format that vim and other tooling can use | |
// Something like: | |
// FILENAME:LINE_NUMBER failed: MESSAGE | |
// For example: | |
// src/test/java/TestFoo.java:42 failed: junit.framework.ComparisonFailure: null expected:<[b]ar> but was:<[B]ar> | |
afterTest { desc, result -> | |
if (result.resultType == TestResult.ResultType.FAILURE) { | |
result.getException().each { e -> | |
e.getStackTrace().each { el -> |
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
" Indent Guides highlighting | |
" https://github.com/nathanaelkane/vim-indent-guides/issues/38 | |
" https://github.com/nathanaelkane/vim-indent-guides/issues/109 | |
" Taken from 1) :set background=light 2) :hi IndentGuidesEven | |
hi IndentGuidesEven guifg=#E3DDCC guibg=#CCC6B7 | |
" Taken from 1) :set background=light 2) :hi IndentGuidesOdd | |
hi IndentGuidesOdd guifg=#CCC6B7 guibg=#E3DDCC |
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
# example usage: docker-compose dahn --remove-orphans | |
docker-compose_dahn() { | |
command docker-compose down "$@" | |
} | |
docker-compose() { | |
local cmd=$1; shift | |
if command -v "docker-compose_$cmd" >/dev/null 2>/dev/null; then | |
"docker-compose_$cmd" "$@" | |
else | |
command docker-compose "$cmd" "$@" |
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/env bash | |
# Adapted from: | |
# https://twitter.com/kapeli/status/649852908025040896 | |
bundle list \ | |
| awk -F'[ ()]+' '$2 == "*" {system("sleep 3"); print "dash-install://repo_name=Ruby%20Docsets&entry_name=" $3 "&version=" $4;}' \ | |
| xargs open |
OlderNewer