Skip to content

Instantly share code, notes, and snippets.

View westonganger's full-sized avatar

Weston Ganger westonganger

View GitHub Profile
@westonganger
westonganger / 1 static_rails.rb
Last active March 30, 2023 05:03 — forked from WattsInABox/.gitignore
Generate Static HTML Website Using Ruby on Rails
# config/environments/static.rb
require File.expand_path('../development', __FILE__)
# environment for serving static pages like error pages to upload to S3
MyApp::Application.configure do
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
@westonganger
westonganger / rbenv-install-system-wide.sh
Created June 8, 2016 16:41 — forked from jpfuentes2/rbenv-install-system-wide.sh
CentOS: rbenv install and system wide install
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
@westonganger
westonganger / or_scopes.rb
Created May 27, 2016 01:19 — forked from craigweston/or_scopes.rb
OR'ing scopes
module ActiveRecord
module Querying
delegate :or, :to => :all
end
end
module ActiveRecord
module QueryMethods
# OrChain objects act as placeholder for queries in which #or does not have any parameter.
# In this case, #or must be chained with any other relation method to return a new relation.