Skip to content

Instantly share code, notes, and snippets.


Jay Killeen jaykilleen

View GitHub Profile
iscott /
Last active Jul 17, 2021
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
sigmadream / Capfile
Last active Apr 28, 2016
Deploy Rails 5.0.0.beta3(Nginx, Puma, Capistrano3, PostgreSQL, rbenv)
View Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/nginx'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
require 'capistrano/rbenv'
require 'capistrano/rails'
require 'capistrano/rails/db'
require 'capistrano/rails/console'
require 'capistrano/upload-config'
View gfm_table.css
body {
text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
arjunvenkat / gist:1115bc41bf395a162084
Last active Jul 26, 2021
Seeding a Rails database with a CSV file
View gist:1115bc41bf395a162084

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

JamesMGreene /
Last active Jul 26, 2021
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

randomecho / australian-postcodes.sql
Last active Jul 22, 2021
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
View australian-postcodes.sql
Taken and cribbed from
May contain errors where latitude and longitude are off. Use at own non-validated risk.
DROP TABLE IF EXISTS postcodes_geo;