Skip to content

Instantly share code, notes, and snippets.

module PumaCapacityToCloudwatch
require 'puma_capacity_to_cloudwatch/utilization'
require 'puma_capacity_to_cloudwatch/publish'
class Error < StandardError; end
def self.run
sleep 10 # wait for puma to boot up
return unless defined?(Puma)
#!/bin/sh
# Purpose: a minimalistic provisioning of a fresh vagrant box
# based on Ubuntu 17.04 for Rails development.
# Created: 2017-09-25
# Updated: 2017-09-25
# Uses shell as the provisioner - https://docs.vagrantup.com/v2/provisioning/shell.html
# Avoid using official Canonical boxes since they do not conform to Vagrant's standards
# Vagrant's officially supported are the bento boxes.
#!/bin/sh
# Purpose: a minimalistic provisioning of a fresh vagrant box
# Ubuntu 16.04 LTS (Xenial Xerus) rails development.
# Created: 2017-01-30
# Updated: 2017-01-31
#
# Uses shell as the provisioner.
# More details https://docs.vagrantup.com/v2/provisioning/shell.html
#!/bin/sh
# Purpose: minimalistic provisioning of a fresh vagrant box ubuntu/trusty64 for
# rails development. Uses shell as the provisioner.
# More details https://docs.vagrantup.com/v2/provisioning/shell.html
# Original File: https://gist.github.com/guycall/430dca8985f56924e03a
# Ensure OS is up to date
sudo apt-get update
sudo apt-get dist-upgrade
@guycall
guycall / gist:11088683
Created April 19, 2014 16:01
Very quick and dirty Ruby script to download a backup of AppFog database via the AppFog API
# Purpose: Download a full export of an AppFog database
# API details taken from https://github.com/lucperkins/appfog-api-docs
require 'json'
require 'httparty'
require 'zip'
# Fetch your AppFog token
# You may need to run the command 'af login' if your token has expired
file_contents = File.read('/home/vagrant/.af_token')
@guycall
guycall / gist:5166243
Last active December 14, 2015 23:29
Below are some instructions to very quickly add file uploading to a Rails 3.1/3.2 app using the gems active_scaffold_vho and carrierwave (https://github.com/vhochstein/active_scaffold & https://github.com/jnicklas/carrierwave )

Added to Gemfile

gem 'render_component_vho'
gem 'active_scaffold_vho'
gem 'kaminari'
gem 'carrierwave'

Run the following commands

bundle install