Skip to content

Instantly share code, notes, and snippets.

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

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 Nov 20, 2013
back to coffee for rendr
View AddClassMapping.coffee
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 Oct 25, 2013
facebook-button.html
View example.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 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
#!/bin/sh
[[ -d $(dirname $0)/../rebase-merge ]] || lolcommits --capture
@trshafer
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 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)