Skip to content

Instantly share code, notes, and snippets.

View MattSurabian's full-sized avatar

Matthew Surabian MattSurabian

View GitHub Profile
@MattSurabian
MattSurabian / Makefile
Created June 10, 2015 13:16
How I cut reproducible builds in Go projects. The nice part about this method is that it allows devs to work on a project in a standard Go development environment while also allowing someone who ONLY HAS GO INSTALLED to clone an application anywhere they want and compile it from source. No deps need to be committed to the project repo and no rel…
# A Makefile for Go projects
# This "makes" it easy to cut reproducible builds using an ignored _vendor
# directory and built in Go tooling. When this runs, it first executes the
# vendor.sh shell script. It then temporarily "blesses" your GOPATH with
# the _vendor directory. This ensures all modules will first be looked for
# in _vendor and anything else will get picked up from your standard Go workspace.
GO_CMD=$(shell which go 2>/dev/null)
GO_TEST=$(GO_CMD) test
GO_BUILD=$(GO_CMD) build
@MattSurabian
MattSurabian / credentials
Created June 2, 2015 02:17
Sample AWS CLI credentials file which includes the profile rubberduck in addition to the default.
[default]
aws_access_key_id = SOME_ACCESS_KEY_ID
aws_secret_access_key = SOME_SECRET_KEY_ID
[rubberduck]
aws_access_key_id = SOME_ACCESS_KEY_ID
aws_secret_access_key = SOME_SECRET_KEY_ID
@MattSurabian
MattSurabian / podcast-producer-iam.json
Created June 2, 2015 02:12
The IAM policy we use for the Rubber Ducking podcast.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::rubberduckcast.com/*",
"arn:aws:s3:::rubberduckcast.com",
"arn:aws:s3:::episodes.rubberduckcast.com/*",
@MattSurabian
MattSurabian / DATE-TITLE.md
Last active August 29, 2015 14:22
Basic post markdown file required for a podcast site powered by Jekyll
---
layout: episode
number: "000"
duration: "TIME:CODE:LENGTH"
length: "FILE_BYTES"
title: "The Episode's Title"
short_description: "This is a short description about the episode."
aac_asset_link: "LINK TO AAC ENCODED EPISODE"
ogg_asset_link: "LINK TO OGG ENCODED EPISODE"
@MattSurabian
MattSurabian / output
Last active August 29, 2015 14:20
Output of the ProXPN Bash Client
$ proxpn
Welcome to the ProXPN OpenVPN Bash Client!
Which exit node would you like to use?
1) UK 4) Singapore 7) LA 10) Miami
2) Sweden 5) Dallas 8) NYC 11) Czech
3) Netherlands 6) BASIC 9) Seattle
Select an exit node:9
@MattSurabian
MattSurabian / hoist.js
Last active August 29, 2015 14:17
Example of JS hoisting
// In this case the variable hoisted ends up being declared
// but undefined before the if statement, because it is hoisted
(function(){
try {
if (hoisted) {
var hoisted = true;
console.log("This will not get printed")
}else{
console.log("This will be printed, because hoisted has been declared, but is not set to a truthy value.")
}
@MattSurabian
MattSurabian / Quiche.md
Created February 26, 2015 02:50
Quiche Recipe

Quiche

It's not just for breakfast. It can make a great dinner!

Ingredients

  • 1.5 cups of milk
  • 1.5 cups of shredded cheese
  • 3 eggs
  • Filling of your choice:
@MattSurabian
MattSurabian / awebp.sh
Last active August 29, 2015 14:06 — forked from mzgoddard/awebp.sh
#!/bin/zsh
movieInput=$1
tmpFolder=$2
outName=$3
mkdir -p $tmpFolder
ffmpeg -i $movieInput $tmpFolder/%03d.png
for i in `ls $tmpFolder`; do
j=`echo $i | sed s/\.png/.webp/`
@MattSurabian
MattSurabian / nginx-force-ssl.conf
Created August 25, 2014 20:18
Boiler plate NGINX SSL config for serving a locally running application. Replace everything surrounded with <>.
server {
listen 80;
server_name <FQDN>;
rewrite ^ https://$server_name$request_uri? permanent;
}
@MattSurabian
MattSurabian / .bash_git
Created April 8, 2014 15:32
This can be appended to .bash_profile it will allow the prompt to display the current branch and branch-status
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 256)
else
MAGENTA=$(tput setaf 5)