Skip to content

Instantly share code, notes, and snippets.

View beneggett's full-sized avatar

Ben Eggett beneggett

View GitHub Profile
@beneggett
beneggett / test_helper.rb
Created September 4, 2013 21:44
test/test_helper.rb
ENV["RAILS_ENV"] = "test"
require "coveralls"
Coveralls.wear!
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"
require "minitest/rails"
require "email_spec"
# To add Capybara feature tests add `gem "minitest-rails-capybara"`
# to the test group in the Gemfile and uncomment the following:
@beneggett
beneggett / .zshrc
Last active December 23, 2015 07:39
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="muse"
DISABLE_AUTO_UPDATE="true"
DISABLE_LS_COLORS="false`"
plugins=(git sublime bundler brew gem rails3)
export EDITOR="sub --wait"
source $ZSH/oh-my-zsh.sh
@beneggett
beneggett / git-techniques.md
Last active February 6, 2016 06:28
Git techniques as discussed in class & learned by going through the code school class

Learning Git

Personalizing Git: Common settings

git config --list      // Checks your current git configuration settings
git config --global core.editor "sub --wait"     // Sets sublime text to be the default editor for commit messages
git config --global user.name "John Doe"   // Sets up the default name for Git Commits
git config --global user.email "[email protected]" // Sets up the default email for Git Commits

Ruby in 100 Minutes

About Ruby

Ruby was written to make the programmer's job easy and not care if the computer's job is hard. In this brief introduction we'll look at the key language features you need to get started.

Key Language features

  1. Instructions and Interpreters
@beneggett
beneggett / ruby-encryptor-exercise.md
Created September 24, 2013 22:26
Ruby Encryptor Exercise

Encryptor

Have you ever wanted to send a secret message?

The Plan

Today we use computers to mask messages every day. When you connect to a website that uses "https" in the address, it is running a special encoding on your transmissions that makes it very difficult for anyone to listen in between you and the server.

@beneggett
beneggett / .powenv
Last active February 17, 2017 22:55
.powenv
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if
@beneggett
beneggett / savvi-user-payment-integration-api.md
Created October 10, 2013 15:29
Savvi User & Payment Integration API for Call Centers

Savvi User & Payment Integration API for Call Centers

This guide covers the inner working of Braintree's Payment API & Savvi's RESTful API. It assumes a basic understanding of the principles of REST.

There are two steps that need to happen in order to successfully enroll a Savvi member:

1.) Create an customer with a credit card & billing address with Braintree

2.) Post the user's information to Savvi including the newly created Braintree token via the "Creating Call Center Members via API" method.

@beneggett
beneggett / savvi-membership-api.md
Last active December 25, 2015 05:38
Savvi Wholesale Partners API

Savvi Membership API for Wholesale Partners

This guide covers the inner working of Savvi's RESTful API. It assumes a basic understanding of the principles of REST.

The REST API is designed to give developers a convenient way to access data contained within Savvi. As Savvi continues to grow, the API will continue to be developed.

Making an API Call

Savvi provides a staging and production URL for creating users.

Staging URL: http://www.savvi-staging.com/api/v1/

@beneggett
beneggett / gist:7016378
Last active December 25, 2015 17:49
Email Basics
Configure your email settings:
In config/environments/development.rb:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'localhost:3000',
user_name: ENV['GMAIL_EMAIL'],
password: ENV['GMAIL_PASSWORD'],
authentication: 'plain',
@beneggett
beneggett / contact-form-seo.md
Created October 18, 2013 21:59
Creating a Contact Form, Mailer

Creating a Contact Form & Mailer

Create a working contact form in your application that will allow a user to send you an email. At a minimum should have a sender email, subject, and body as part of the form. It should have validations that make sure that required fields are submitted & email address is properly formatted. The messages should not be ultimately stored in the database, you can choose how to implement that (Non-active record model vs destroying entries after create)/

Instructions

  • Create a message model
  • Create a contact us controller with new & create actions & associated views
  • Create a mailer & associated views (use layout if you have one)
  • Hook the mailer up to the create action in your contact us controller