Skip to content

Instantly share code, notes, and snippets.

View jnewman12's full-sized avatar
🎯
Focusing

James Newman jnewman12

🎯
Focusing
  • Santa Monica, CA
View GitHub Profile
@jnewman12
jnewman12 / active_storage.md
Last active June 16, 2019 09:44
WDI DTLA Active Storage Intro

File Uploads with Rails and Active Storage

rails + active-storage


Lesson Objectives

  • set up an account on Amazon Web Services to store uploaded images inside AWS S3
  • set up rails app to handle file uploads
  • understand the how and why, of a rails model with an image attribute
@jnewman12
jnewman12 / js_debugging.md
Created June 14, 2018 08:18
WDI DTLA JS Debugging

Chrome Dev Tools

Objectives

After this lesson, students will be able to:

  • Open and describe the components of the Chrome developer tools
  • Use the developer tools to manipulate page elements (HTML/CSS)

Preparation

Before this lesson, students should already be able to:

@jnewman12
jnewman12 / carmen_san_diego.md
Created June 14, 2017 05:26
WDI SM Carmen San Diego

Use SQL to find Carmen Sandiego

Introduction

Where In The World Is Carmen Sandiego?

We're going to use what we've learned already about searching with SQL commands, and apply it to chase down and capture an elusive and world-reknowned thief, Carmen Sandiego. Follow the clues, use the interweb - write down both the SQL commands /queries you used and your answers to the clues - and figure out where Carmen's headed, so we can catch her and bring her in.

Exercise

@jnewman12
jnewman12 / active_record.md
Created June 14, 2017 05:25
WDI SM intro to active record

ActiveRecord Methods and Finders

Objectives

  • Query a model using AR methods
  • Instantiate and create a new instance of a model
  • Edit a model's attributes
  • Destroy a model

Preparation

  • Write a model that inherits from ActiveRecord
@jnewman12
jnewman12 / sql.md
Created June 14, 2017 05:22
WDI SM SQL

Intro to SQL

Objectives

After this lesson, students will be able to:

  • Create a database table
  • Insert, retrieve, update, and delete a row or rows into a database table

Preparation

@jnewman12
jnewman12 / intro_sql.md
Created June 14, 2017 05:19
SM WDI intro to SQL

Intro to Relational Data Modeling

Objectives

After this lesson, SWBAT:

  • Describe the relationship between tables, rows, and columns
  • Draw entity relationship diagrams (ERDs) with crow's foot notation for ideas for web apps
  • Describe how tables relate to each other using foreign keys
  • Explain the different relationship types – one to one, one to many, many to many
@jnewman12
jnewman12 / gh_pages.md
Last active June 8, 2017 21:19
Github pages intro

Your project on github pages

  • first, make sure you have been pushing your project to github
  • if you're in a good spot for your project, commit and push to master

gh-pages branch

  • go into your project directory in your terminal
  • run git checkout -b gh-pages
  • then run git commit -am "gh-pages branch"

What is a Callback?

A reference to executable code, or a piece of executable code, that is passed as an argument to other code.

All a callback is, is a function that takes a function as an argument.

Here is an example

function mySandwich(param1, param2, callback) {
 alert('Started eating my sandwich.\n\nIt has: ' + param1 + ', ' + param2);
@jnewman12
jnewman12 / bling.md
Last active May 31, 2017 16:55
WDI 47 SM Fellowship of the bling

Fellowship of the Bling ($)

Frodo ponders the power of the ring.

Using our new-found knowledge of jQuery, create a function for each of the following steps to practice DOM Manipulation, JavaScript, and jQuery.

Setup

@jnewman12
jnewman12 / practice.js
Last active June 13, 2018 23:04
WDI Week #1 JS Practice Problems
/*
1. Counting Sheep
Consider an array of sheep where some sheep may be missing from their place.
We need a function that counts the number of sheep present in the array (true means present).
*/
var arr = [true, true, true, false,
true, true, true, true ,
true, false, true, false,
true, false, false, true ,
true, true, true, true ,