Skip to content

Instantly share code, notes, and snippets.

View barakcodes's full-sized avatar

barakcodes barakcodes

View GitHub Profile
@barakcodes
barakcodes / sst-static-assets.ts
Created August 3, 2024 14:45
sst ion public asset component
// abstract
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
import { all, output, Output } from "@pulumi/pulumi";
import { VisibleError } from "../error.js";
import { Input } from "../input.js";
import { Prettify } from "../component.js";
import { BaseSiteFileOptions, limiter } from "./base-site.js";
import { DevArgs } from "../dev.js";
@barakcodes
barakcodes / useBroadcastChannel.ts
Created February 5, 2024 12:12 — forked from KristofferEriksson/useBroadcastChannel.ts
A React hook that allows you to send and receive messages between browser tabs or windows
import { useCallback, useEffect, useRef, useState } from "react";
interface UseBroadcastChannelOptions {
name: string;
onMessage?: (event: MessageEvent) => void;
onMessageError?: (event: MessageEvent) => void;
}
interface UseBroadcastChannelReturn<D, P> {
isSupported: boolean;
@barakcodes
barakcodes / .eslintrc.json
Created March 28, 2018 22:58 — forked from leny/.eslintrc.json
ESLint config file for node.js + ES6 projects.
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,