Skip to content

Instantly share code, notes, and snippets.

View brobertsaz's full-sized avatar

Bob Roberts brobertsaz

  • Self
  • Madison, WI
  • 17:09 (UTC -05:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am brobertsaz on github.
  • I am ninjabob (https://keybase.io/ninjabob) on keybase.
  • I have a public key ASBWE5xmaTJtQxIsaUir94tPgCadptMZyg2mYdgVJfbBFwo

To claim this, I am signing this object:

@brobertsaz
brobertsaz / serversetup.md
Last active July 6, 2020 08:56
Ubuntu 12.04 Ruby, Rails, Nginx, Unicorn

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
require 'rmagick'
class GetColors
def initialize(image, brand, campaign=nil)
@image = image
@brand = brand
@campaign = campaign
end
@brobertsaz
brobertsaz / Contract Killer 3.md
Created April 21, 2016 03:39 — forked from malarkey/Contract Killer 3.md
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

@brobertsaz
brobertsaz / serversetup.md
Last active January 4, 2016 18:28
Ubuntu Precise Rails, Nginx, Unicorn and Capistrano ('2.15.5') Server Setup

Ubuntu Precise Rails, Nginx, Unicorn and Capistrano ('2.15.5') Server Setup

I originally tried to use the ~> 3.0 version of Capistrano, but fell back to the 2.15.5 version. There were a lot of changes in the new version that I did not feel like learning right at the moment...

1. Setup deploy user

First we will create a new user for deployment:

$ ssh into your server

#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production
@brobertsaz
brobertsaz / activity_log
Last active December 17, 2015 13:10
changing table rows with jquery
.activity-log-header
%p.low
Refine results by Organization
%p
= select_tag 'search[query]', options_for_select(@organizations), class: 'chosen-select', prompt: "Search for organization to select", id: 'org-selection'
.activity_log_results
%table.fancy-table
%thead
%tr
%th Date
((15, 'less_than', 30) == true)
@brobertsaz
brobertsaz / js-welcome-full
Created April 25, 2013 00:15
JS Welcome Dialog
:javascript
$(document).ready(function()
{
checkForWelcome();
}
);
function checkForWelcome() {
var userWelcome = "#{@current_user.hide_welcome}";
if (userWelcome == "false") {