Skip to content

Instantly share code, notes, and snippets.

View lawso017's full-sized avatar

William Lawson lawso017

View GitHub Profile
@lawso017
lawso017 / invalid_json_test.rb
Last active August 29, 2015 14:13
Setting invalid JSON terminally breaks ActiveRecord object [Rails 4.2/PG using json datatype]
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'pg'
GEMFILE
system 'bundle'
end
@lawso017
lawso017 / mentionable_trix.js.coffee
Last active November 14, 2024 14:26
@mentions with trix-editor and selectize.js
window.addEventListener "trix-initialize", (e) =>
Utility.TrixMentions.prepare($(e.target))
@lawso017
lawso017 / vpc-fargate.yaml
Created September 23, 2019 21:36 — forked from lizrice/vpc-fargate.yaml
Cloudformation template for setting up VPC and subnets for Fargate
# Usage:
# aws cloudformation --region <region> create-stack --stack-name <stack name> --template-body file://vpc-fargate.yaml
# This template will:
# Create a VPC with:
# 2 Public Subnets
# 2 Private Subnets
# An Internet Gateway (with routes to it for Public Subnets)
# A NAT Gateway for outbound access (with routes from Private Subnets set to use it)
#
@lawso017
lawso017 / shipstation-packing-list-items.html
Last active April 28, 2022 04:06
HTML for ShipStation packing list template that inverts the text (white on black) for line items with quantity greater than one
<style>
td.quantity {
font-size: 16px;
font-weight: bold;
color: white;
background-color: black;
}
td.quantity.quantity-1 {
color: black;
background-color: white;