Skip to content

Instantly share code, notes, and snippets.

View b17z's full-sized avatar
🎯
Focusing

Bienvenido Rodriguez b17z

🎯
Focusing
  • Coinbase
  • Williamsburg, Brooklyn, NYC
View GitHub Profile
@b17z
b17z / Sequelize.md
Last active January 26, 2022 02:44 — forked from Julissa93/Sequelize.md
Sequelize Lifecycle
@b17z
b17z / day10-exit-ticket.md
Created July 5, 2020 05:53 — forked from nrl240/day10-exit-ticket.md
Exit Ticket: Day 10 - Express Custom Error Handling, Eager Loading with Sequelize

Exit Ticket: Day 10 - Express Custom Error Handling, Eager Loading with Sequelize

In your own words, what is eager loading?

  • The equivalent to doing an INNER JOIN in SQL.
  • Reference:
    • Sequelize: Eager Loading

      As briefly mentioned in the associations guide, eager Loading is the act of querying data of several models at once (one 'main' model and one or more associated models). At the SQL level, this is a query with one or more joins).

      When this is done, the associated models will be added by Sequelize in appropriately named, automatically created field(s) in the returned objects.

@b17z
b17z / day6-exit-ticket.md
Created July 5, 2020 05:22 — forked from nrl240/day6-exit-ticket.md
Exit Ticket: Day 6 - Express and Handling Asynchronous Code

Exit Ticket: Day 6 - Express and Handling Asynchronous Code

In your own words, what is a server?

What is the purpose of the package.json file in a Node project?

  • Store a list of dependencies for the project
  • Give the project a name
@b17z
b17z / model-user.js
Created November 13, 2019 17:00 — forked from lucasscariot/model-user.js
Composite Primary Key in Sequelize
/*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},
@b17z
b17z / connect.js
Created October 14, 2019 01:18 — forked from gaearon/connect.js
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@b17z
b17z / git-clearHistory
Created October 9, 2019 19:49 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@b17z
b17z / promise2.js
Created September 15, 2019 14:55 — forked from vkarpov15/promise2.js
Write Your Own Node.js Promise Library from Scratch, Part 2
class MyPromise {
constructor(executor) {
if (typeof executor !== 'function') {
throw new Error('Executor must be a function');
}
// Internal state. `$state` is the state of the promise, and `$chained` is
// an array of the functions we need to call once this promise is settled.
this.$state = 'PENDING';
this.$chained = [];
@b17z
b17z / sample.js
Created August 26, 2019 16:30 — forked from dxlbnl/sample.js
React component Lifecycle methods
class Component extends React.Component {
static getDerivedStateFromProps (nextProps, prevState) {
// -> nextState
// | Called after instantiating and when it receives new props
}
render () {
// -> jsx
}

Articulating Learning Objectives

Effective course design begins with the question, what do I want my students to be able to do or produce by the end of this module?[1] In answering this question, you will articulate course aims and objectives that will guide your choice of topics to cover in each module.


How to Write Effective Learning Objectives

The most effective learning objectives include active verbs and measurable outcomes.

@b17z
b17z / System Design.md
Created March 30, 2019 10:43 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?