Skip to content

Instantly share code, notes, and snippets.

Avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
View 2022-03-phillyrb-pubnite.txt
- Guatemala & Japanese topology
- Rails app for firefighers
- j2ee to rails
- national fire planning standard, building hazards
- Corey Haines connection
- javascript security - https://vulncat.fortify.com/en/detail?id=desc.structural.python.javascript_hijacking_constructor_poisoning#:~:text=Applications%20that%20use%20JavaScript%20notation,engine%20allows%20array%20constructor%20poisoning.
- rails security & attribute checking
- cucumber for performance validation
- apm products https://raygun.com, https://www.elastic.co/observability/application-performance-monitoring
View 2022-01-phillyrb-pubnite.txt
Locations:
Japan
Philly
Massachusettes
- Life in Japan
- New jobs
- Coaching: workflow, scrum, kanban
- Work from home
@matschaffer
matschaffer / switch_to_main.sh
Last active Jan 26, 2022
A bash helper for switching a local clone and a github fork from master to main.
View switch_to_main.sh
#!/usr/bin/env bash
set -euo pipefail
echo ":: Renaming local master to main"
git branch -m master main || true
git fetch origin
git remote set-head origin -a
if git remote show upstream >/dev/null 2>&1; then
@matschaffer
matschaffer / gist:942981
Created Apr 26, 2011 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
View gist:942981
$ git branch -r --merged |
sed '/>|master/d;/origin/!d;s:origin/::' |
xargs git push origin --delete
# I think this will work, but I don't know how to get git branch to show me that -> line
@matschaffer
matschaffer / morse_generator.ino
Created Jan 23, 2022
Circuit Playground Express - Morse generator
View morse_generator.ino
#include <Adafruit_CircuitPlayground.h>
void setup() {
CircuitPlayground.begin(10);
CircuitPlayground.clearPixels();
pinMode(A1, INPUT_PULLUP);
}
void loop() {
if (digitalRead(CPLAY_LEFTBUTTON) || !digitalRead(A1)) {
View 2022-01-phillyrb-pubnite.txt
locations:
vancouver
west chester
santa monica
new babies and reaching #3
hashicorp IPO
consulting with nyc companies
View fps_steps.rb
Given /^I expect to pay \$(\d+) via amazon$/ do |arg1|
price = arg1.to_f
mock_pipeline_request = mock('pipeline_request',
:url => sekret_payment_path(:transaction_amount => price))
Remit::API.any_instance.
expects(:get_recurring_use_pipeline).
with{ |opts| opts[:transaction_amount] == price }.
returns(mock_pipeline_request)
@matschaffer
matschaffer / .env
Created Oct 20, 2021
docker-compose.yml
View .env
env-hyphens=ok
env.dots=ok
@matschaffer
matschaffer / gist:4912279e49dce41ab9b2
Last active Jul 6, 2021
Bash-friendly ec2 prices
View gist:4912279e49dce41ab9b2
#!/usr/bin/env bash
URL="http://a0.awsstatic.com/pricing/1/ec2/ri-v2/linux-unix-shared.min.js"
(echo 'function callback(data) { console.log(JSON.stringify(data)); }'; curl -s "$URL") |\
node |\
jq -r '.config.regions[] |
select(.region == "us-east-1") |
.instanceTypes[] |
[
@matschaffer
matschaffer / check-attached-policies.sh
Created Mar 19, 2021
Shows all role and user policies - Helpful for deprecation of AWSElasticBeanstalkService
View check-attached-policies.sh
for R in $(aws iam list-roles --query 'Roles[].RoleName[]' --output text); do
echo "$R"
aws iam list-attached-role-policies --role-name "$R"
done
for U in $(aws iam list-users --query 'Users[].UserName[]' --output text); do
echo "$U"
aws iam list-attached-user-policies --user-name "$U"
done