Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
programming

Zach Caceres zcaceres

👨‍💻
programming
View GitHub Profile
@zcaceres
zcaceres / Testing-Wikistack.md
Created Mar 14, 2017
testing wikistack notes
View Testing-Wikistack.md

Testing (Wikistack)

1. Don't become a Horror Story

2. How to Start


A Brief History of Testing:

People (a script) ==> Macros (automated scripts) ==> Unit Testing (starting 1990's)

1. Don't become a horror story

@zcaceres
zcaceres / Mechanics-of-Promises.md
Created Mar 15, 2017
understanding the behavior of promises under multiple conditions – FSA 1702 - March 15, 2017
View Mechanics-of-Promises.md

Mechanics of Promises

Understanding Javascript Promise Generation & Behavior

1. Good Old Promises

2. The Magic of Promises


1. Good Old Promises

Explain the behavior of promises under multiple conditions. Build my own promise library

@zcaceres
zcaceres / HTML-CSS-SCSS-Shoestring.md
Last active Mar 16, 2017
Layout Laid Out – FSA 1702 – March 16, 2017
View HTML-CSS-SCSS-Shoestring.md

HTML/CSS/SCSS Shoestring

Layout Laid Out – FSA 1702 – March 16, 2017

1. Layout

2. SCSS


1. Layout

Layout is where Html (content) and CSS (style) meet.

@zcaceres
zcaceres / Sequelize-Step-by-Step.md
Last active Aug 30, 2021
Let's get an overview of Sequelize!
View Sequelize-Step-by-Step.md

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.
View debugging.md

Debugging JavaScript Applications

A practical distillation for Fullstack Academy students

Faults in computer problems were theorized as far back as 1843, when Ada Lovelace noted of Babbage's Analytical Engine, "Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders." Almost 160 years later, NIST reported that software errors cost the US $59 billion annually. Clearly, some of the cards are wrong. However, unlike Grace Hopper's famous moth, most of the time the culprit is ourselves.

Debugging is a sanitization procedure consisting of:

  • Preventing bugs in the first place, through good practices and assistive tooling.
  • Detecting bugs when they first arise, through proper error handling and testing.
@zcaceres
zcaceres / jQuery-Trip-Planner.md
Created Mar 21, 2017
jQuery for Trip Planner App – FSA 1702 – March 21, 2017
View jQuery-Trip-Planner.md

JQuery

FSA 1702 – March 21, 2017


Introduction

It's about interacting with the DOM tree. jQuery happens on the client-side and is executed in the browser.

Front-End Applications == User Interfaces

@zcaceres
zcaceres / Revealing-Module-Pattern.md
Last active Aug 28, 2021
Using the Revealing Module Pattern in Javascript
View Revealing-Module-Pattern.md

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

View Organizing-Projects.md

Organizing Projects

  1. Keep things small
  2. Self-documenting variable names
  3. READMEs
  4. Comments
  5. Make 'interfaces' as though you're designing a public API with private implementation details
  • List our user views / actions
  • ERD
  • Look at each view
@zcaceres
zcaceres / AJAX-TripPlanner.md
Created Mar 22, 2017
AJAX – FSA 1702 – March 22, 2017
View AJAX-TripPlanner.md

AJAX – Let's Get A-Jacked!

FSA 1702 – March 22, 2017

AJAX helps us make requests from the client-side.


Old HTTP Requests

Each time we do a URL bar query we re-render the HTML completely. The same is true with a POST request using a form.

AJAX allows us to move HTTP requests to the background and replace only part of the DOM.

View Events-and-Socket-io.md

Events and Socket.io

FSA 1702, March 24, 2017


Event Emitters

Objects that can emit specific events with a payload to any number of registered listeners.

Event Emitters look a bit like event handlers. We're familiar with listening for events, but emitters take this one step further.

Event Emitters come with two functions. .on and .emit.