Skip to content

Instantly share code, notes, and snippets.

View lcds90's full-sized avatar
🏳️‍🌈

Leonardo Santos lcds90

🏳️‍🌈
View GitHub Profile
@ErickWendel
ErickWendel / concat-streams.mjs
Last active May 19, 2023 18:04
Example of how to consume multiple Web APIs in parallel via Node.js Streams
// npm i axios stream-concat
import { pipeline } from 'stream/promises'
import StreamConcat from 'stream-concat'
import axios from 'axios'
const API_01 = 'http://localhost:3000'
const API_02 = 'http://localhost:4000'
const streams = (await Promise.all([
axios({
@sebjwallace
sebjwallace / reduxObjectLiteral.js
Last active May 25, 2022 06:44
Redux reducer using object literal instead of a switch statement
import {createStore} from 'redux';
const counter = (state = 0, action) => {
const index = {
'INCREMENT': () => {
return state+1;
},
'DECREMENT': () => {
return state-1;
},
@basham
basham / css-units-best-practices.md
Last active June 6, 2024 02:06
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units