Skip to content

Instantly share code, notes, and snippets.

@matthewdordal
matthewdordal / introrx.md
Created November 24, 2020 15:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@matthewdordal
matthewdordal / discover-program-using-port-8080.md
Last active February 20, 2020 17:50
What program is using port 8080

in terminal

$ lsof -i :8080 | grep LISTEN

node      33328 z001922   30u  IPv4 0x716bf89633a758d5      0t0  TCP localhost:http-alt (LISTEN)

The name “node” doesn’t tell you anything, to get the detail, use ps like this

@matthewdordal
matthewdordal / package.json
Created October 7, 2019 15:01
Check Node Despendencies for Updates
"script": {
"depCheck": "npx npm-check -u"
}
@matthewdordal
matthewdordal / async-await-and-promises
Last active August 1, 2019 16:13
Async/Await and Promises
const P = val => {
return new Promise(resolve => {
setTimeout(() => resolve(val), 1000)
})
}
const usePromise = () => {
console.log('start')
P('async val').then(res => {
@matthewdordal
matthewdordal / useCustomReducer - with const assertion
Created April 24, 2019 17:08
TypesScript custom useReducer hook example
import React from "react";
const setOpen = (open: boolean) =>
({
type: "SET_OPEN",
payload: { open }
} as const);
const setTitle = (title: string) =>
({
@matthewdordal
matthewdordal / npm-list-globally.md
Created July 23, 2018 19:36 — forked from brenopolanski/npm-list-globally.md
Listing globally installed NPM packages and version
npm list -g --depth=0
@matthewdordal
matthewdordal / tutorial.md
Created July 18, 2018 15:03 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.