This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
NODES = [ | |
['proxy', 1, 10], | |
['app', 1, 20], | |
['db', 1, 30], | |
['cache', 1, 40] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest' | |
require 'minitest/spec' | |
require 'minitest/autorun' | |
describe 'Regexes are super great' do | |
before do | |
@month = "12" | |
@day = "15" | |
@year = "2014" | |
@date = "#{@month}/#{@day}/#{@year}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am xionon on github. | |
* I am alechipshear (https://keybase.io/alechipshear) on keybase. | |
* I have a public key whose fingerprint is 7D65 BBE1 3BD5 E1F7 891E D8A3 3586 6DC4 A359 A3E5 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updated by Siege 3.0.5, February-03-2014 | |
# Copyright 2000-2013 by Jeffrey Fulmer, et al. | |
# | |
# Siege configuration file -- edit as necessary | |
# For more information about configuring and running | |
# this program, visit: http://www.joedog.org/ | |
# | |
# Variable declarations. You can set variables here | |
# for use in the directives below. Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ApplicationController | |
respond_to :html, :json | |
before_action :find_post, only: %i(show edit update destroy) | |
before_action :find_posts, only: %i(index) | |
def index | |
respond_with decorate(@posts) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
def run | |
puts 'Does the thing' | |
end | |
end | |
class Bar | |
include Foo | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# see: http://guides.rubyonrails.org/action_controller_overview.html#rescue-from | |
rescue_from ApiKey::NotAuthorized, with: :api_key_not_authorized | |
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found | |
private | |
# see: http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render | |
def record_not_found | |
render file: '404.html', status: :not_found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace 'manage', as: '' do | |
resources :programs | |
end | |
#---- | |
$ rake routes | |
Prefix Verb URI Pattern Controller#Action | |
programs GET /manage/programs(.:format) manage/programs#index | |
POST /manage/programs(.:format) manage/programs#create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensures that we can save a news item and queue up the right jobs around it | |
class NewsSaveService | |
def self.save!(news) | |
new(news).save! | |
end | |
def initialize(news) | |
@news = news | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r app-with-ar/Gemfile app-without-ar/Gemfile | |
6,7d5 | |
< # Use sqlite3 as the database for Active Record | |
< gem 'sqlite3' | |
diff -r app-with-ar/Gemfile.lock app-without-ar/Gemfile.lock | |
97d96 | |
< sqlite3 (1.3.9) | |
123d121 | |
< sqlite3 | |
diff -r app-with-ar/config/application.rb app-without-ar/config/application.rb |
OlderNewer