Skip to content

Instantly share code, notes, and snippets.

View adamgamble's full-sized avatar

Adam Gamble adamgamble

View GitHub Profile
# Make sure you do this from time to time:
sudo apt-get update && sudo apt-get upgrade -y
# Here are the actual packages (feel free to contribute):
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev nodejs libssl-dev libreadline6-dev libreadline-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev ncurses-term automake libtool bison subversion libcurl4-openssl-dev mysql-client mysql-server postgresql postgresql-contrib imagemagick libmagickwand-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libaprutil1-dev redis-server vim -y
# Make default editor vim :)
echo "export EDITOR=vim" >> ~/.bashrc
# Install RVM
Blog::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# DO not eager load code on boot.
config.eager_load = false
class Comment < ActiveRecord::Base
belongs_to :article
validates_presence_of :name, :email, :body
validate :article_should_be_published
after_create :email_article_author
after_create :send_comment_email
def article_should_be_published
class ArticlesController < ApplicationController
before_action :authenticate, except: [:index, :show]
before_action :set_article, only: [:show]
# GET /articles
# GET /articles.json
def index
@articles = Article.all
end
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Blog
class Application < Rails::Application
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Blog
class Application < Rails::Application
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
$10 iTunes Gift Card
product = Spree::Product.find 11666
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => 11622).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
$5 Claire's Gift Card
product = Spree::Product.find 11689

Keybase proof

I hereby claim:

  • I am adamgamble on github.
  • I am adamgamble (https://keybase.io/adamgamble) on keybase.
  • I have a public key whose fingerprint is 803B BDE1 0706 E85B 3941 9EF8 31EE C9D3 5026 8305

To claim this, I am signing this object:

01/01/04
#########
some notes
02/02/04
##########
more notes