Skip to content

Instantly share code, notes, and snippets.

@mdang
mdang / RSPEC.md
Last active July 14, 2022 18:41
Rspec Cheat Sheet

Rspec Cheat Sheet

# Equivalence
expect(target).to eq 1
expect(target).not_to eq 1

expect(user.id).to eq("foo")

expect(user).to be_a(FooApp::User)
@mdang
mdang / DEPLOYMENT_HEROKU_RAILS.md
Last active April 25, 2017 13:46
Deploying a backend app to Heroku

Deploying a Rails app to Heroku

Learning Objectives

  • Why do we need to deploy our code?
  • Explain the difference between PaaS and IaaS
  • Deploy an app to Heroku
  • Run a Heroku app locally
  • Set up a remote database
  • Configure a remote server
@mdang
mdang / SPA.md
Last active November 29, 2016 16:33
Lesson: Single Page Applications

Single Page Applications

Lesson Objectives

  • Explain what it means to develop a single page application
  • Explain the pros and cons of developing a single page application
  • Describe the different ways to implement a Single Page Application
  • Compare and contrast the roles of JS and Rails in a fully functional AJAX application
  • Explain how Rails differentiates between request formats and serves the appropriate content format
  • Use respond_to to create RESTful actions that respond with JSON representations of objects
@mdang
mdang / TODO.md
Created June 15, 2015 20:10
Complete the Todo Single Page Application

Finishing the Todo Single Page Application

Let's take the starter code we have from class and expand upon it.

  • Create an ajax method to delete todo's
  • Add a loading indicator when an ajax request is being processed and hide it when it's complete
  • Add a success message whenever a todo is created or deleted

BONUS

  • Create an ajax method to edit existing todo's
@mdang
mdang / EXPRESS.md
Last active October 13, 2015 13:40
Lesson: Express.js

Express

Lesson Objectives

  • Describe what Express is
  • Install Express
  • Start an Express server
  • Explain what middleware is used for
  • Explain how to serve static content
  • Define routes for different HTTP methods
@mdang
mdang / ASYNC.md
Last active August 29, 2015 14:23
Asynchronous Control Flow with Node.js

Asynchronous Control Flow with Node.js

Differences b/w asynchronous and synchronous code in Node.js

  • Recommended that you stick with aynchronous code whenever possible
  • Synchronous code is blocking for all users since it's single threaded process
  • Blocking code isn't that big of a deal with one user, but with additional users it becomes a huge problem
  • Requires a different way of thinking when it comes to your code

Demonstration

@mdang
mdang / BACKBONE_VIEWS.md
Last active August 29, 2015 14:24
Lesson: Backbone Views & Templating

Backbone Views & Templating

Lesson Objectives

  • Explain why we need templates on the front-end in addition to the server
  • Identify the responsibilities of a "View" in Backbone, and how it differs from a traditional MVC view
  • Describe the purpose of the "el" attribute in a Backbone view
  • Explain the difference between views with an "el" reference versus a "tagName".
  • Describe how Backbone views respond to DOM events
  • Explain why it's important to call "remove" when taking a view out of the DOM.
@mdang
mdang / FREELANCING.md
Last active November 24, 2023 12:27
Lesson: Freelancing

Freelance Development

Learning Objectives

  • Explain what freelance development is and why companies contract developers
  • List what paperwork is generally involved on both sides
  • Explain what a Statement of Work (SOW) is
  • Explain what scope creep is, and how to avoid it
  • Describe the accounting required for freelance developers
  • Explain how to price your services
@mdang
mdang / CLI.md
Last active November 9, 2021 15:46
Lesson: CLI

CLI & Computer Basics

Learning Objectives

  • Describe what the Terminal is and how we can use it to interface with an operating system
  • Compare and contrast the use cases of a CLI vs. a GUI
  • Explain the difference between relative vs. absolute paths
  • Explain what command options are and how to use them
  • Use the most common commands to navigate and modify files / directories via the Terminal window (cd, pwd, mkdir, rm -r, mv, cp, touch)
  • Use the 'pwd' command to see the path of the current directory
@mdang
mdang / EXERCISE_GIT_WHITEBOARD.md
Last active May 14, 2018 14:12
Class Exercise: Git Whiteboard

Git Whiteboard

10 min - Pair Exercise

This exercise will help students understand the value of using a version control system like Git.

  1. Split up into pairs, and grab a whiteboard marker
  2. The first person writes out a full complete sentence
  3. The second person edits the original sentence in any way they want
  4. (2 min) Go back and forth editing the sentence until time is up