Skip to content

Instantly share code, notes, and snippets.

View TheEricMiller's full-sized avatar

Eric TheEricMiller

View GitHub Profile
@TheEricMiller
TheEricMiller / ~application.example.yml
Last active December 16, 2015 06:19
Rails application config file template.
# =======================================
# = ACTIVE SECRETS =
# =======================================
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: changeME123
ROLES: [master, admin, user]
DEVISE_FROM_EMAIL: "Erics Rails <[email protected]>"
DEVISE_SECRET_KEY: "change_me__run_rake_secret_at_terminal_and_paste_in_here"
@TheEricMiller
TheEricMiller / ~database.example.yml
Last active December 16, 2015 06:19
Rails database config file template.
#
# Remember:
# Ensure the appropriate gems are defined
# in your Gemfile for each environment
# gem 'sqlite3'
# gem 'pg'
# gem 'mysql2'
# $ bundle
#
# =======================================
@TheEricMiller
TheEricMiller / .powrc
Last active December 16, 2015 06:39 — forked from nbibler/gist:5307941
.powrc file to use .ruby-version
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@TheEricMiller
TheEricMiller / unicorn.conf.rb
Last active December 16, 2015 06:48
Rails Unicorn config file template (not Rack).
# https://github.com/defunkt/unicorn/tree/master/examples
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
@TheEricMiller
TheEricMiller / ACT_MAILER.application.rb
Created April 17, 2013 03:59
Setup action_mailer with figaro yml in config/application.rb
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.assets.initialize_on_precompile = false
# ActionMailer ========================================================
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => ENV["ACT_MAILER_HOST"] }
@TheEricMiller
TheEricMiller / active_admin.rb
Last active December 16, 2015 12:38
ActiveAdmin ~ change path for active user link in util nav
config.namespace :master do |admin|
admin.build_menu :utility_navigation do |menu|
#menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
menu.add :label => proc{ display_name current_active_admin_user },
:url => '/users/edit',
:id => 'current_user',
:if => proc{ current_active_admin_user? }
admin.add_logout_button_to_menu menu
end
end
@TheEricMiller
TheEricMiller / LocalServerSetup
Last active December 16, 2015 19:30
Local Server setup steps on OSX clean install
~) Install / Update OSX / Xcode + command line tools
~) Install SublimeText2 http://www.sublimetext.com/
$ sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/bin/subl
~) Review http://railscasts.com/episodes/292-virtual-machines-with-vagrant
1) Install http://www.virtualbox.org
2) Install http://www.vagrantup.com
3) Choose a http://www.vagrantbox.es
4) Open Terminal
@TheEricMiller
TheEricMiller / charCombos.rb
Created May 2, 2013 03:59
A test of looping through possible 3 character combos
# TheEricMiller.com ~ A test of looping through possible 3 character combos
@output = File.open( "output.txt", "w" )
def out (content)
@output.puts(content.to_s)
end
def printAlphas
#out("DOMAINSDOMAINSDOMAINSDOMAINSDOMAINSDOMAINSDOMAINS")
EricsRails::Application.configure do
# ActionMailer ===============================================
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => ENV["ACT_MAILER_HOST"] }
config.action_mailer.smtp_settings = {
:address => ENV["ACT_MAILER_SMTP_ADDRESS"],
:user_name => ENV["ACT_MAILER_SMTP_USER_NAME"],
:password => ENV["ACT_MAILER_SMTP_PASSWORD"],
script/boxen --no-fde
Error: Could not update: Execution of 'brew boxen-install boxen/brews/nginx' returned 130: ==> Installing dependencies for nginx: pcre
==> Installing nginx dependency: pcre
Error: /Stage[main]/Nginx/Package[boxen/brews/nginx]/ensure: change from absent to 1.2.7-boxen1 failed: Could not update: Execution of 'brew boxen-install boxen/brews/nginx' returned 130: ==> Installing dependencies for nginx: pcre
==> Installing nginx dependency: pcre
Notice: /Stage[main]/Nginx/Service[dev.nginx]: Dependency Package[boxen/brews/nginx] has failures: true