Skip to content

Instantly share code, notes, and snippets.

View jhonywalkeer's full-sized avatar
🎯
Focusing

Jhony Walker jhonywalkeer

🎯
Focusing
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({
@maateusilva
maateusilva / detectabs.js
Last active November 26, 2021 19:38
JavaScript Snippet to detect when tab is closed
// Get or Create a new tab id (accessible only on the tab itself)
var tabID = sessionStorage.tabID ? sessionStorage.tabID : sessionStorage.tabID = Math.random();
// Get all connected tabs from localStorage (shared between all tabs)
var connectedTabs = localStorage.getItem("ConnectedTabs");
// Validate if tabID was created
if (tabID) {
if (!connectedTabs) {
// If there's no tabs connected yet, create an array with itself tabID
var tabs = [tabID];
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 27, 2024 23:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example