Skip to content

Instantly share code, notes, and snippets.

Avatar

Jay Killeen jaykilleen

View GitHub Profile
@sigmadream
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;
}
@randomecho
randomecho / australian-postcodes.sql
Last active Jun 6, 2021
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
View australian-postcodes.sql
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@arjunvenkat
arjunvenkat / gist:1115bc41bf395a162084
Last active Jun 6, 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.

@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active Jun 15, 2021
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password
View simple_authentication_rails_5_bcrypt_and_has_secure_password.md

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.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Jun 21, 2021
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

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

Connect to the remote repository