Skip to content

Instantly share code, notes, and snippets.

@thattimc
thattimc / gist:9a8d6f91bb547d461f9a4bfd5c54e115
Created May 27, 2017 12:18
Install PostgreSQL Using Brew On OSX
# update & install
brew update
brew install postgres
# create postgres db
postgres -D /usr/local/var/postgres
create your username db
createdb `whoami`
@thattimc
thattimc / HOWTO.md
Created April 28, 2017 06:27 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@thattimc
thattimc / Contract Killer 3.md
Created March 25, 2016 11:18
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@thattimc
thattimc / application_helper.rb
Created July 5, 2015 05:08
Embedded SVG to Rails
def embedded_svg(filename, options = {})
assets = Rails.application.assets
file = assets.find_asset(filename).body.force_encoding("UTF-8")
doc = Nokogiri::HTML::DocumentFragment.parse file
svg = doc.at_css "svg"
if options[:class].present?
svg["class"] = options[:class]
end
raw doc
end