Skip to content

Instantly share code, notes, and snippets.

View celestelayne's full-sized avatar
🌴
coding

Celeste celestelayne

🌴
coding
View GitHub Profile
@celestelayne
celestelayne / pair_programming_roles
Last active July 31, 2019 02:05 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@celestelayne
celestelayne / authentication_with_bcrypt_in_rails_4.md
Created February 23, 2019 12:34 — forked from eerwitt/authentication_with_bcrypt_in_rails_4.md
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@celestelayne
celestelayne / Sequelize-Step-by-Step.md
Created January 24, 2019 15:28 — forked from zcaceres/Sequelize-Step-by-Step.md
Let's get an overview of Sequelize!

Sequelize: Step-By-Step

Sequelize is a powerful library in Javascript that makes it easy to manage a SQL database. Sequelize can layer over different protocols, but here we'll use PostgreSQL. At its core, Sequelize is an Object-Relational Mapper – meaning that it maps an object syntax onto our database schemas. Sequelize uses Node.JS and Javascript's object syntax to accomplish its mapping.

Under the hood, Sequelize used with PostgreSQL is several layers removed from our actual database:

  1. First, we write our Sequelize, using Javascript objects to mimic the structure of our database tables.
  2. Sequelize creates a SQL string and passes it to a lower-level library called pg (PostgreSQL).
  3. pg connects to your PostgreSQL database and queries it or transforms its data.
  4. pg passes the data back to Sequelize, which parses and returns that data as a Javascript object.
@celestelayne
celestelayne / RAILS_CHEATSHEET.md
Created October 26, 2018 00:10 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@celestelayne
celestelayne / gist:fc3f78475c6a77e1aa7104a0f912a312
Created March 5, 2017 01:46 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

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.

@celestelayne
celestelayne / pull_requests.md
Created February 28, 2017 05:23 — forked from arjunvenkat/pull_requests.md
Creating Pull Requests
  1. Fork the repo that you're working on into your own account.
  2. Clone down the fork
  3. Create a new branch in the fork using git branch [branch_name] replacing [branch_name] with a short phrase describing the feature your'e working on
  4. Check the current status of your branches by using git branch. You should see all the branches you have access to. Your current branch will have an * next to it
  5. Check out the new branch using git checkout [branch_name]
  6. Make your changes in the code
  7. Add and commit your changes
  8. Pull down any changes from the original repo:
  9. Add the original repo as an upstream remote with git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git. Make sure to use the actual owner and repository names.
  10. Pull changes into your branch from the upstream remote with git pull upstream master
@celestelayne
celestelayne / branches.md
Created February 28, 2017 05:23 — forked from arjunvenkat/branches.md
Creating your own branchs

Creating and working with branches in Git

  1. Create a branch with git branch [your_branch_name]
  2. Checkout the branch with git checkout [your_branch_name]
  3. Publish your branch with git push origin [your_branch_name]
  4. Do some work, commit your changes
  5. When your branch is done, checkout master with git checkout master
  6. Pull down any changes from master with git pull
  7. Checkout your branch again and make sure it is up to date with master using git merge master
  8. If there are any conflicts, fix them. If not, you may need to exit the Vim text editor using :wq
@celestelayne
celestelayne / Contract Killer 3.md
Created February 13, 2016 19:49 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@celestelayne
celestelayne / gist:31c9f8baecfcf3a4c337
Created May 16, 2015 04:30 — forked from afeld/gist:4952991
API Data List { No Auth Needed }