Skip to content

Instantly share code, notes, and snippets.

View beneggett's full-sized avatar

Ben Eggett beneggett

View GitHub Profile
@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
@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 / 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 / Gemfile
Last active December 19, 2015 14:49
All my development tools in a gemfile
group :development do
gem "pry"
gem "powder"
gem "letter_opener"
gem "better_errors", ">= 0.7.2"
gem "binding_of_caller", ">= 0.7.1"
gem 'meta_request'
gem "html2haml", ">= 1.0.1"
gem 'guard'
gem 'rb-fsevent', require: false
# Letter opener config:
# https://github.com/ryanb/letter_opener
...
# Change mail delvery to either :smtp, :sendmail, :file, :test
config.action_mailer.delivery_method = :letter_opener
....
@beneggett
beneggett / gist:4060792
Created November 12, 2012 17:45 — forked from anonymous/2.txt
Error CONNECTION REFUSED
def create_url
country = Country.where(:name => params[:country]).first
@wine = Wine.create(
:name => params[:name],
:country => BSON::ObjectId.from_string(country.id.to_s),
:region => params[:region],
:varietal => params[:varietal],
:producer => params[:producer],
:wine_type => params[:wine_type],
:year => params[:year],
#...
namespace :deploy do
desc "reload the database with seed data"
task :seed do
run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}"
end
end
#...
## Create User
User.create! :first_name => "Test", :last_name => "User", :email => "[email protected]", :password => "password123"# add whatever other parameters you have here
# if you wanted to make user an admin (which I'm assuming you do if it's in a seed file) do:
u = User.create! :first_name => "Test", :last_name => "User", :email => "[email protected]", :password => "password123"
u.spree_roles << Spree::Role.find_or_create_by_name("admin")
@beneggett
beneggett / twitter-bootstrap-presentation.md
Created September 5, 2012 23:56
Twitter Bootstrap Presentation

This Presentation was built to be viewed with GistDeck

Twitter Bootstrap & Responsive Design

DRUG September 5, 2012

Ben Eggett