Skip to content

Instantly share code, notes, and snippets.

View Jlevyd15's full-sized avatar

Jeremy Levy Jlevyd15

View GitHub Profile
@Jlevyd15
Jlevyd15 / stacked_prs.md
Created November 17, 2019 17:58
Stacked PRs with Git and Github

How to create a stacked PR with git and Github 📚

Create a feature branch from the master brach

  • from the master branch create a feature branch called feat1
  • git checkout master -> git checkout -b feat1

Make some changes and commit them

  • git add .
  • git commit
@Jlevyd15
Jlevyd15 / service_workers.md
Last active April 21, 2019 00:07
Service worker basics

service worker state changes

when you register a service worker it returns a promise, that promise is resolved with a "service worker registration object"

navigator.serviceWorker.register('/sw.js').then(reg => {
// registration object methods
// reg.unregister()
// reg.update()
})
@Jlevyd15
Jlevyd15 / http2_overview.md
Last active August 30, 2018 04:07
HTTP/2 TLDR;

HTTP/2

Overview taken from HERE

  • Reduced preception of latency
  • allows for multiple concurrent exchanges between client/server
  • prioritization of requests

just extending HTTP/1 not replacing anything

@Jlevyd15
Jlevyd15 / question.md
Last active May 20, 2018 16:39
Interview Question

We will be building a Tabs UI, similar to Bootstrap Tabs

  • There should be 3 tabs, associated with vote_average returned by the API. (Low, Average, High)
    • Theses tabs should contain the movies with these vote ranges (Low: <= 6.0, Average: 6.1 > 7.9, High: >= 8)
  • Clicking on each of the tabs will display a list of movies associated with that vote range e.g. clicking on Low will only show movies with an average rating of 6.0 or lower.
  • The list should display the movie's id, vote_average, and release_date date properties
  • The list of movies should be sorted by most-recent release_date date first
  • At any given point, the UI should display which tab is active
  • When loading the UI for the first time, the first tab should be active
@Jlevyd15
Jlevyd15 / bower_install.md
Created April 20, 2018 04:02
Using a web component in a static html file

#1. Check if node is installed

  • open Terminal and run the command below node -v
  • if it outputs something like this v8.9.1 then continue to setp 3.

#2. Install node.js

  • go HERE and click the left green button to install the LTS version of node.js
  • repeat step #1. to make sure the install was successfull.

#3. Install Bower package manager

  • run this command npm i -g bower
@Jlevyd15
Jlevyd15 / index.html
Created April 16, 2018 13:57
less test
<div class="test">test div</div>
<div class="test-2">test div</div>
@Jlevyd15
Jlevyd15 / Immutable JS Examples
Created December 15, 2017 16:55 — forked from singhshivam/Immutable JS Examples
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);

ES6 object destructuring

const { store } = this.props 

Assigning a constant like this to the object on the right side will pull out the value for the key that has the same name as the variable (in this case store) and assigns it to the store variable. It's the equivalent to below syntax

const store = this.props.store
@Jlevyd15
Jlevyd15 / This-in-JavaScript.md
Last active February 12, 2017 06:09
How to use the "this" keyword in Javascript

this in JavaScript 📝

"this" allows us as the developer to use an objects context when calling a function. You can choose which object you would like to call a function with, even if that object does not have the function as one of it's properties.

Example: If there is one common function you have, like sayHello you want that function to work with many objects that have similar properties.

var personOne = {
	name: "Bob",
	age: 35,