Skip to content

Instantly share code, notes, and snippets.

rails db:reset

John Cordero johncorderox

rails db:reset
Block or report user

Report or block johncorderox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JessCodes /
Last active Apr 2, 2018
Rails, Bower, Materialize, Heroku in 10 Steps!

Rails, Bower, Materialize, Heroku

  1. To install Bower, you need to have to have node, npm, and git installed. Then run npm install -g bower
  2. Create a bower.json file and add:
  "name": "personal-website",
  "dependencies": {
    "jquery": "latest",
    "materialize": "latest",
eliotsykes /
Last active Nov 30, 2019
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
  rails new APP_PATH [options]

  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
nfarrar /
Last active Nov 24, 2019
Learning Computer Security

Learning Computer Security

About This Guide

This is an opinionated guide to learning about computer security (independently of a university or training program), starting with the absolute basics (suitable for someone without any exposure to or knowledge of computer security) and moving into progressively more difficult subject matter.

It seems that most people don't realize how much information is actually available on the internet. People love to share (especially geeks) and everything you need to become well versed in computer security is already available to you (and mostly for free). However, sometimes knowing where to start is the hardest part - which is the problem that this guide is intended to address. Therefore, this guide can accuratley be described as a 'guide to guides', with additional recommendations on effective learning and execises, based on my own experiences.

Many of the free resources are the best resources and this guide focuses on them. It is intended to provided a comprehensive

HeroicEric /
Created Apr 2, 2014
An example of how to create a RSpec test helper

RSpec Helper Example

Here's an example of a rspec test helper that will let you sign in as a given user.

Create spec/support/helpers/authentication.rb with the following:

module Helpers
  module Authentication
    def sign_in_as(user)
harssh-sparkway / dry.rb
Last active May 24, 2019
Don’t Repeat Yourself (DRY) in Ruby on Rails
View dry.rb
#Don’t Repeat Yourself (DRY) in Ruby on Rails
#DRY (Don’t Repeat Yourself) is a principle of Software Development to reducing repetition of information or codes. We can #apply DRY quite broadly to database schema, test plan, system, even documentation. And in this post, we will take example of DRY #in Ruby on Rails development.
#In particular case, if you find some methods whose definitions are more or less similar, only different by the method name, it #may use meta programming to simplify the things to make your model more clean and DRY. Consider this simple example where we #have an article with three states.
class Article < ActiveRecord::Base
kyletcarlson / rspec_model_testing_template.rb
Last active Dec 5, 2019
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
View rspec_model_testing_template.rb
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
# @kyletcarlson
# This skeleton also assumes you're using the following gems:

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.


The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

digitaljhelms / gist:4287848
Last active Dec 5, 2019
Git/GitHub branching standards & conventions
View gist:4287848


Quick Legend

Instance Branch Description, Instructions, Notes
You can’t perform that action at this time.