Skip to content

Instantly share code, notes, and snippets.

View revans's full-sized avatar
🤠
Building Businesses

Robert Evans revans

🤠
Building Businesses
View GitHub Profile
@revans
revans / user_script.sh
Last active October 27, 2020 18:16
AWS User Script for getting a server ready for Ruby, Rails, Sinatra, or Rack apps.
#!/usr/bin/env bash
#
# Author: Robert R Evans
#
# Description: AWS Ubuntu 13 Ruby Setup Script
#
# This script will setup a ubuntu box for Ruby, Rails, Sinatra, and/or Rack
# development/staging/production usage. It also installs Nodejs, Nginx, Git,
# Rbenv, and PostgreSQL adapters for using RDMS PostgreSQL. It assumes that
# git-deploy will be used, in place of the traditional capistrano deployments.
module ObjectDiagnostics
extend self
#This is handy when you want to determine what types of objects are contributing to memory bloat
#returns the change in object counts since the last time this method was called
def change_in_object_counts
#this will start all counts at 0 for the initial run
@previous_counts ||= Hash.new(0)
@revans
revans / github_releases.rb
Created November 1, 2013 18:07
Get the latest releae
require 'net/https'
require 'json'
require 'uri'
module MightyOctocat
class Releases
attr_reader :owner, :repo
# ==== Arguments
#
@revans
revans / git-pr
Last active December 26, 2015 03:39
Git Extension for easily pulling down specific Pull Requests from github or setting your local repository to access all Pull Requests
#!/bin/bash
set -e
arg=$1
function specific_pull_request() {
echo "Fetching Pull Request '${arg}' from Github..."
git fetch origin pull/$arg/head:pr-$arg
}
# /etc/init/project-web-reload.conf
pre-start script
initctl restart project-web
sleep 15
end script
exec /usr/local/rvm/bin/default_bluepill restart
/****************************/
If coming from the list page
<div class="list-breadcrumb">
Breadcrumb code
</div>
If coming from the spot page
@revans
revans / .bash_profile
Last active December 19, 2015 14:48
This should be your $HOME/.bash_profile file
# Make sure packages know OSX is 64bit
export ARCHFLAGS='-arch x86_64'
# Homebrew Path Setup
export PATH=/usr/local/bin:/usr/local/sbin/:$HOME/bin:$PATH
# NPM Path Setup
export PATH=$PATH:/usr/local/share/npm/lib/node_modules
# Rbenv Path Setup
#!/usr/bin/env bash
set -e
# setup colors to indicate good, ok, and bad for test coverage
green="\033[0;32m"
red="\033[0;31m"
reset="\033[0m"
msg() {
echo "${green}\n$1${reset}"
@revans
revans / Instructions.mkd
Last active December 19, 2015 14:28
Instructions for setting up a local machine for Ruby, Rails, Sinatra, etc development.

Ruby & Rails

If you're unfamiliar or looking to get more familiar with Ruby & Rails, then checkout this tutorial and this learning site.

System Setup

Installing Homebrew will make it much easier to install the necessary libraries.

@revans
revans / osx_installer.sh
Last active October 4, 2016 05:31
OSX Installer of Homebrew, Rbenv, various homebrew libraries, rbenv plugins, gems, and ruby 1.9.3
#!/usr/bin/env bash
#
# Homebrew & Ruby setup for OSX
#
set -e
# Setup some array's
declare -a brew_libs=(apple-gcc42 openssl readline zlib libxml2 libyaml librsvg libiconv git curl solr wget redis sqlite memcached ack phantomjs mysql node)
declare -a rbenv_plugins=(ruby-build rbenv-vars rbenv-default-gems rbenv-gem-rehash)