Skip to content

Instantly share code, notes, and snippets.

View spenserpothier's full-sized avatar
🍔

Spenser Pothier spenserpothier

🍔
View GitHub Profile
@spenserpothier
spenserpothier / findResourceByType.zsh
Created April 10, 2020 20:54
Shell command to search through regions and profiles and return all `resourceNames` and `resourceIds` for a given ResourceType. meant to be sourced into an RC
function findResourcesByType() {
if (($# == 0)) then
echo "\nUsage: findResourceByType <ResourceType>"
echo "\nResourceType list can be found at https://docs.aws.amazon.com/cli/latest/reference/configservice/list-discovered-resources.html#options"
return 1;
fi
# Fill these with the names of the profiles and regions you want to look through, space seperated
PROFILES=()
REGIONS=()
for o in $PROFILES; do
@spenserpothier
spenserpothier / exportOptions-AdHoc-Distribution.plist
Last active December 13, 2019 18:44
Use xcodebuild for iOS builds
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
<key>teamID</key>
<string>10_DIGIT_DEVELOPER_ID</string>
<key>provisioningProfiles</key>
<dict>
<key>MY_APP_BUNDLE_ID</key>
@spenserpothier
spenserpothier / getGoTools.sh
Last active April 8, 2019 23:25 — forked from tydavis/getGoTools.sh
Setup Go tools
#!/bin/sh
go get -u github.com/dougm/goflymake
go get -u github.com/acroca/go-symbols
go get -u github.com/alecthomas/gometalinter
go get -u github.com/cweill/gotests/...
go get -u github.com/davidrjenni/reftools/cmd/fillstruct
go get -u github.com/derekparker/delve/cmd/dlv
go get -u github.com/dominikh/go-tools/cmd/keyify
go get -u github.com/fatih/gomodifytags
@spenserpothier
spenserpothier / curl.sh
Last active August 29, 2017 17:19
cURL with username/password
curl -k -X POST --netrc-file passfile https://url.with.auth.com
@spenserpothier
spenserpothier / awk_replace_string_with_file.sh
Last active August 16, 2017 18:42
Replace REPLACEME in fileB with the contents of fileA with " " prepended to each line, save to fileC
# Replace REPLACEME in fileB with the contents of fileA with " " prepended to each line, save to fileC
awk 'NR==FNR { a[n++]=" "$0; next }
/REPLACEME/ {for (i=0; i<n; ++i) print a[i]; next }
1' fileA fileB > fileC
@spenserpothier
spenserpothier / workweek.sh
Last active August 16, 2017 20:22
Script to figure out how much code type work I did this week
#!/bin/zsh
ls -1 -d */ | while read i
do
cd "$i"
if [ -d .git ]
then
{
ncommits=$(eval 'git log --oneline --author="Spenser" --since="`date -v monday`" | wc -l' 2> /dev/null )
} || {
@spenserpothier
spenserpothier / gist:3d1cb9f1ad0ccc9bcc95
Last active August 16, 2017 20:24
Example cucumber output
$ cucumber
Using the default profile...
Feature: Manage Articles
In order to make a blog
As an author
I want to create and manage Articles
Scenario: Articles List # features/manage_articles.feature:6
Given I have articles titled Pizza, Breadsticks # features/step_definitions/article_steps.rb:1
When I go to the list of articles # features/step_definitions/web_steps.rb:48
[alias]
lg = log --format=\"%h - %C(cyan)%s%Creset %C(dim white)(%ar) [%an - %ae]%Creset%n%w(72,4,4)%b\"
@spenserpothier
spenserpothier / gist:8b5363931d742a7fd60a
Last active August 16, 2017 20:25
Onename/openname verification
Verifying that +spenserpothier is my openname (Bitcoin username). https://onename.com/spenserpothier