Skip to content

Instantly share code, notes, and snippets.

View m3talsmith's full-sized avatar

Michael Christenson II m3talsmith

View GitHub Profile
@m3talsmith
m3talsmith / rcov-12202012
Created December 20, 2012 17:22
Bulletin builder code coverage improvement process
48.41%

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
@m3talsmith
m3talsmith / scope
Created December 10, 2012 21:21
various route options
scope ':facility_name', as: 'facility' do
resources :channels
end
@m3talsmith
m3talsmith / sort_spec.rb
Created December 6, 2012 16:23
Translation sorting test
it 'displays the preferred translation in the bulletin' do
# check that it shows the preferred translation
translations = @bulletin.hymn.hymn_items.first.translations
translation_types = @bulletin_setting.translation_types
translations.first.position.should == 0
translation_types.first.position.should == 0
translations.each do |translation|
codes = translation_types.map(&:code)
m3talsmith: Bryan and I have thought of our first Windows 8 App to make already
m3talsmith: We are helping a school update their tech here pro bono
m3talsmith: and they are getting surfaces
m3talsmith: So we are going to make a collaborative social learning system
m3talsmith: We'll take advantage of Surface Glass
m3talsmith: and local zero conf sharing
m3talsmith: I'm thinking we can make an IOS and Android version of it as well
@m3talsmith
m3talsmith / Gemfile
Created September 27, 2012 18:46
Edge Rails base Gemfile
source 'https://rubygems.org'
# Bundle edge Rails
gem 'rails', github: 'rails/rails'
gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
gem 'journey', github: 'rails/journey'
gem 'sqlite3'
# Gems used only for assets and not required
@m3talsmith
m3talsmith / anonymous user
Created September 21, 2012 21:04
Cart walkthroughs
Cart is created as a cookie
Items can be added to cart
When checking out
Anon adds email, shipping, and phone
Cart is processed
When successful
Cart creates a new order, fills in details of order from cart info, clears cart
@m3talsmith
m3talsmith / regex
Created September 20, 2012 18:58
email regex
^[a-zA-Z\w\W]+@[a-z]+\.[a-z]{3}$
@m3talsmith
m3talsmith / gist:3624415
Created September 4, 2012 18:15
Bare server install notes
sudo su
cd ~
apt-get -y update
apt-get -y install wget curl build-essential libc6-dev zlib1g-dev libssl-dev libreadline-dev libyaml-dev
libcurl4-openssl-dev curl git-core python-software-properties libsqlite3-dev make libreadline6-dev libz-dev
wget http://ftp.ruby-lang.org/pub/ruby/ruby-1.9.2-p320.tar.gz
tar -zxvf ruby-1.9.2-p320.tar.gz
cd ruby-1.9.2-p320
@m3talsmith
m3talsmith / sample.html
Created August 21, 2012 19:57
Dropdown not working
<div class='navbar' id='header'>
<div class='navbar-inner'>
<div class='container'>
<a class='btn btn-navbar' data-target='.nav-collapse' data-toggle='collapse'>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
</a>
<a href="/" class="brand">Wexford Jewelers</a>
<form accept-charset="UTF-8" action="/search" class="navbar-search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>