Docker is an open-source project to easily create lightweight, portable, self-sufficient containers. The same container that a developer builds and tests on a laptop can run at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uninstall any existing node and nodenv brew packages | |
$ brew uninstall node nodenv nodenv-default-packages node-build-update-defs | |
Move any existing nodenv config out of the way | |
$ mv ~/.nodenv ~/.nodenv.orig | |
Start a new shell | |
Clone the nodenv repo in a scratch directory | |
$ cd Code/scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# References: | |
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/ | |
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/ | |
# | |
global | |
nbproc 2 | |
maxconn 16384 | |
defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "\nBootstrapping this machine...\n" | |
# Install HomeBrew | |
# HOMEBREW_PREFIX="/opt/homebrew" | |
if ! command -v brew >/dev/null; then | |
echo "- Installing Homebrew..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
include Pundit | |
# Verify that controller actions are authorized. Optional, but good. | |
after_filter :verify_authorized, except: :index | |
after_filter :verify_policy_scoped, only: :index | |
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
nbproc 1 | |
maxconn 65536 | |
defaults | |
timeout connect 5s | |
timeout queue 5s | |
timeout server 30s | |
timeout tunnel 1h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client < ActiveRecord::Base | |
has_many :projects | |
scope :active, -> { where(active: true) } | |
end | |
class Project < ActiveRecord::Model | |
belongs_to :client | |
scope :active, -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The steps for upgrading a Heorku PostgreSQL database. | |
# | |
# https://devcenter.heroku.com/articles/upgrading-heroku-postgres-databases | |
# https://elements.heroku.com/addons/heroku-postgresql | |
heroku addons:create heroku-postgresql:hobby-basic -r production | |
heroku pg:info -r production | |
# Note the database names, we'll call them HEROKU_POSTGRESQL_NEW_URL and HEROKU_POSTGRESQL_OLD_URL | |
heroku maintenance:on -r production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script captures a series of git commands that emcompass merging a feature into a target branch, like | |
# development or master. It updates the target branch and rebases the feature before merging with --no-ff. | |
# The end result is that there's always a merge commit and all of the commits are at the top of the timeline. | |
# This makes for easier to read git histories, especially with active teams. | |
# Is this a git repo? | |
if [[ ! -d .git ]]; then | |
echo "\nDirectory is not a git repo. Exiting...\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Opinionated instructions for setting up a laptop for development at Carbon Five. | |
# Not intended to be run wholesale; read, interpret, tweak (maybe), then run piece by piece. | |
# | |
# Tested against Yosemite 10.10. | |
#-------------------------------------- | |
# Install Homebrew. | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
NewerOlder