Skip to content

Instantly share code, notes, and snippets.

trshafer /
Created Oct 30, 2014
remove untagged "<none>" images in docker
docker images | grep "<none>" | awk '{print $3}' | tr "\\n" " " | xargs docker rmi
trshafer / index.html
Last active Aug 29, 2015
publish with onTextData
View index.html
<!doctype html>
<html lang="en">
<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 /
Last active Aug 29, 2015
Upload ssl certificate to cloudfront

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

This is the cloudfront documentation:

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 /
Created Nov 20, 2013
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 / example.html
Created Oct 25, 2013
View example.html
<!DOCTYPE html>
<link href="" rel="stylesheet">
<link href="" rel="stylesheet">
<style type="text/css">
padding: 0px;
overflow: hidden;
trshafer / benchmark.js
Created Oct 18, 2013
Benchmark for model store checking params
View benchmark.js
var BaseModel, ModelStore, modelUtils, _;
ModelStore = require('../shared/store/model_store');
BaseModel = require('../shared/base/model');
modelUtils = require('../shared/modelUtils');
_ = require('underscore');
util = require('util');
View 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)
View post-commit
[[ -d $(dirname $0)/../rebase-merge ]] || lolcommits --capture
trshafer / Gemfile
Created Feb 17, 2013
TDD Bus implementation with Keith
View Gemfile
gem 'rspec'
gem 'debugger'
View have_body_text.rb
RSpec::Matchers.define :have_body_text do |text|
match do |mail|
fail("No body content to check for #{text}") if
assert_mail_text_in_all_parts(mail, text)
def assert_mail_text_in_all_parts(mail, text) do |part|