Skip to content

Instantly share code, notes, and snippets.

Patrick Brandt patrickbrandt

Block or report user

Report or block patrickbrandt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
patrickbrandt / stream.go
Created Jan 15, 2019
My answer to rot13
View stream.go
// my answer:
// their answer:
package main
import (
patrickbrandt / fib.go
Created Dec 16, 2018
Fibonacci in Go
View fib.go
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
// this is my solve to
func fibonacci() func() int {
next := -1
Risk Mitigation
The inability to get stories “Ready” The customer's product owner is responsible for ensuring that stories have proper acceptance criteria. The delivery team is responsible for other artifacts like wireframes and design comps.

The contract could include a stipulation that a dedicated delivery team will be maintained only if the product owner is able to fulfill their obligation to provide acceptance criteria in a timely manner. Otherwise, the supplier is responsible for ensuring any other supporting documentation is provided so that coders can build the application.
Points Complexity The software developer’s perspective
1 XS
Severity Type Description
  • Blocks development, testing or content entry such that project milestones are jeopardized
View empty-s3-buckets.js
const bb = require('bluebird');
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
const removeObject = (bucketName, obj) => {
const params = {
Bucket: bucketName,
Key: obj.Key,
patrickbrandt /
Last active Mar 13, 2018
Restricting Lambda function by IP address
import json
import os
def ping(event, context):
ip1 = event['headers']['X-Forwarded-For'].split(',')[0]
ip2 = event['requestContext']['identity']['sourceIp']
print('two different referring IP address parsing techniques ip1: %s and ip2: %s') % (ip1, ip2)
referringIP = event['requestContext']['identity']['sourceIp']
#TODO: use a comma-delimited string to store multiple IP address values in the environment variable
patrickbrandt / S3-readonly-bucket.json
Created Nov 22, 2016
IAM Policy for read-only S3 bucket access
View S3-readonly-bucket.json
"Version": "2012-10-17",
"Statement": [
"Sid": "AllowUserToSeeBucketListInTheConsole",
"Action": [
"Effect": "Allow",
patrickbrandt / angularExample.js
Last active Mar 16, 2016
Network connectivity-check worker + angular 1 service wrapper
View angularExample.js
.controller('MainCtrl', ['connectivityService', function(connectivityService) {
console.log('back online');
console.log('lost connection');
You can’t perform that action at this time.