Skip to content

Instantly share code, notes, and snippets.

View trshafer's full-sized avatar

Thomas Shafer trshafer

View GitHub Profile
@trshafer
trshafer / remove_none_images.sh
Created October 30, 2014 19:21
remove untagged "<none>" images in docker
docker images | grep "<none>" | awk '{print $3}' | tr "\\n" " " | xargs docker rmi
@trshafer
trshafer / index.html
Last active August 29, 2015 14:07
publish with onTextData
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta http-equiv="Content-type" content="text/html; charset=us-ascii" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="description" content="" />
<title>ActionScript Publisher</title>
@trshafer
trshafer / directions.md
Last active August 29, 2015 14:02
Upload ssl certificate to cloudfront

A successful ssl upload command to cloudfront using a ssl certificate signed by comodo.

This is the cloudfront documentation: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html#CNAMEsAndHTTPS

Here's my successful command:

aws iam upload-server-certificate --server-certificate-name myServerCertificate --certificate-body file:///Users/..../from_comodo.pem --private-key file:///Users/.../server.key.pem --certificate-chain file:///Users/.../chain.pem --path=/cloudfront/production/

Replace /Users/.... with the path to those files. And yes keep the three three slashes in the beginning.

@trshafer
trshafer / AddClassMapping.coffee
Created November 20, 2013 23:44
back to coffee for rendr
ModelUtils = require('../../shared/modelUtils')
module.exports = class AddClassMapping
constructor: (@utils)->
@utils ||= new ModelUtils
add: (key, modelConstructor)=>
@utils._classMap[@utils.underscorize(key)] = modelConstructor;
@trshafer
trshafer / example.html
Created October 25, 2013 20:01
facebook-button.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
.btn-facebook{
padding: 0px;
overflow: hidden;
@trshafer
trshafer / benchmark.js
Created October 18, 2013 00:23
Benchmark for model store checking params
var BaseModel, ModelStore, modelUtils, _;
ModelStore = require('../shared/store/model_store');
BaseModel = require('../shared/base/model');
modelUtils = require('../shared/modelUtils');
_ = require('underscore');
util = require('util');
@trshafer
trshafer / pre-commit
Created August 9, 2013 22:04
pre-commit
#!/usr/bin/env ruby
# do not check in code with <<<<< nor debugger
diff_contents = `git diff --cached --unified=0 --diff-filter=AM -z HEAD`
bad_commit_text = diff_contents =~ /^\+(<{3,}|(\s*|.*;\s*)debugger)/
abort "Aborting: Found debugger or <<< in commit diff." if bad_commit_text
# looks for text in reminders.txt
reminder_location = 'ignored/reminders.txt'
file_location = File.join( File.dirname(__FILE__), '..', '..', reminder_location)
@trshafer
trshafer / post-commit
Created August 9, 2013 22:03
post-commit
#!/bin/sh
[[ -d $(dirname $0)/../rebase-merge ]] || lolcommits --capture
@trshafer
trshafer / Gemfile
Created February 17, 2013 04:40
TDD Bus implementation with Keith
gem 'rspec'
gem 'debugger'
RSpec::Matchers.define :have_body_text do |text|
match do |mail|
fail("No body content to check for #{text}") if mail.parts.blank?
assert_mail_text_in_all_parts(mail, text)
end
def assert_mail_text_in_all_parts(mail, text)
mail.parts.all? do |part|
part.body.include?(text)