Skip to content

Instantly share code, notes, and snippets.

@juliarose
juliarose / color.rb
Created August 12, 2015 13:01
Ruby color module - for blending two colors, lightening colors, and darkening colors.
module Color
def self.to_hex(c) # convert decimal to hex
n = c.to_i.to_s(16)
n = '0' + n unless n.length > 1 # 2 characters
n
end
def self.to_dec(c) # convert hex to decimal
c.to_i(16)
end
@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