Skip to content

Instantly share code, notes, and snippets.

View malerba118's full-sized avatar

Austin Malerba malerba118

View GitHub Profile
import { BinstaClient } from 'binsta';
const FOLDER_ID = 'nw6iuC4rIK';
const binsta = new BinstaClient(process.env.API_TOKEN);
const file = await binsta.files.get('JZ7tbWj45g');
const root = await binsta.folders.get('root');
const untitled = await binsta.folders.create();
const photos = await binsta.folders.create({ name: 'photos' });
import {
Box,
IconButton,
IconButtonProps,
Tooltip,
useClipboard,
} from "@chakra-ui/react";
import React from "react";
import { BiCopy as CopyIcon, BiCheck as CopiedIcon } from "react-icons/bi";
import { Webhooks, Event } from "@resend/next";
// do signing secret check internally to verify entity calling endpoint
const webhooks = new Webhooks(process.env.RESEND_SIGNING_SECRET);
webhooks.on(Event.EmailDelivered, (data) => {
// data object is fully-typed according to event type
});
webhooks.on(Event.EmailOpened, (data) => {
@malerba118
malerba118 / tokenized-twitter-from-search.js
Created November 24, 2022 02:45
tokenized-twitter-from-search
// TLDR: simply copy/paste into dev console and then try some searches
const cmp = new Intl.Collator("en").compare;
const inf = Infinity;
const INTRA_BOUND = "[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]";
const OPTS = {
// term segmentation & punct/whitespace merging
class PartSimulator {
terminals: TerminalSimulator[];
terminalsByGroup: Record<number, TerminalSimulator[]>;
terminalsByName: Record<string, TerminalSimulator>;
constuctor(part: db.types.Part) {
this.terminals = this.constructor.terminals.map((terminalDefinition) => {
return new TerminalSimulator({
...terminalDefinition,
const circuit = {
parts: [
{
id: "1",
type: "breadboard",
parentId: null,
position: {
x: 0,
y: 0,
z: 0,
import { useScroll } from 'framer-motion';
const Navbar = () => {
const scroll = useScroll();
const [timeRemaining, setTimeRemaining] = React.useState(readTime);
React.useEffect(() => {
return scroll.scrollYProgress.onChange((progress) => {
setTimeRemaining(Math.floor(readTime * (1 - progress)));
});
@malerba118
malerba118 / ideas.md
Last active November 8, 2021 16:56
slip.so ideas

Experience

I built a CodeSandbox clone while working at Target to facilitate code-sharing around internal component libraries.

Library I was working on to bundle and interpret js files directly in the browser. It didn't actually bundle perse, but it augmented import-maps to support importing data-urls which effectively emulated in-browser bundling. Service workers were another effective approach to this. Service workers could intercept esm imports and send back some local code without ever hitting a remote server.

Theming for Gists

I once made an editor to augment GitHub gists and make them look like carbon embeds. Basically was a proxy api that would fetch the gist, prepend some css to it based on some query params, and then send back the js to the client. Looked something like `<script src="https://supergist.com/malerba118/8bb6f5d15522ea1552c301a7098

@malerba118
malerba118 / parallax.jsx
Created September 3, 2021 02:17
Parallax Brainstorming
const keyframes = {
heading: ({ page, fromPx }) => ({
[page.y - fromPx(50)]: {
y: 30,
opacity: 0
},
[page.y]: {
y: 0,
opacity: 1
},
@malerba118
malerba118 / thoughts.md
Last active January 4, 2021 22:23
Story Pointing Thoughts

Story Pointing Thoughts

The estimated time to complete a story is a function of the person who picks up the story. Therefore, we can't decide a good time estimate for a story until it has been assigned. Below are estimations reflecting how long it would take each person to complete each story.

Austin Karime
set_up_postgres 3 days 1 day
set_up_redux 1 day 2 days
set_up_cicd 3 days 1 day