Skip to content

Instantly share code, notes, and snippets.

View metruzanca's full-sized avatar

Sam Zanca metruzanca

View GitHub Profile
@4ster-light
4ster-light / Program.fs
Created August 3, 2025 10:45
Logic table generator
type Token =
| LParen // Left parenthesis '('
| RParen // Right parenthesis ')'
| NotOp // NOT operator '!'
| AndOp // AND operator '&'
| OrOp // OR operator '|'
| ImpliesOp // Implication operator '->'
| BiconditionalOp // Biconditional operator '<->'
| Variable of string // A logical variable (e.g., "P", "Q")
| Eof // End of file/input marker
@t3dotgg
t3dotgg / try-catch.ts
Last active August 20, 2025 20:45
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@metruzanca
metruzanca / solid.userscript.js
Last active July 17, 2025 20:13
The poor man's SolidJS implemented in 40 lines
const $ = document.querySelector.bind(document),
$$ = document.querySelectorAll.bind(document),
h = (name, props) => Object.assign(document.createElement(name), props);
const context = []
const getCurrentObserver = () => context[context.length - 1]
function createEffect(fn, name) {
const execute = () => {
context.push(execute)
@metruzanca
metruzanca / 401k-contribution-calculator.ipynb
Created May 11, 2023 18:16
Starting a new job in the middle of a calendar year? Want to max out employer contribution match? Use this.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bashbunni
bashbunni / .zshrc
Created October 27, 2022 21:41
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
{
"$schema": "https://solid-resume.vercel.app/schema.json",
"meta": {
"canonical": "https://gist.github.com/metruzanca/751361e5ba58ad06f361ebd430ae6e10",
"version": "v1.0.0",
"lastModified": "2025-03-06T14:56:49.946Z",
"theme": "actual"
},
"basics": {
"name": "Samuele Zanca",
@therne
therne / word-sphere.js
Last active April 20, 2021 02:30
WordSphere - A rotating sphere of words. (NOTE: fuck IE support)
/**
* WordSphere
* Written by Hyojun Kim in 2017. Licensed in MIT.
*/
function wordSphere(canvas, texts, counts, options) {
const π = Math.PI; // happy math!
const {
width = 500,
height = 500,
radius = 150,
@bricker
bricker / amznymous.md
Last active April 23, 2024 11:14
An Amazon Programmer's Perspective (http://pastebin.com/BjD84BQ3)

Originally posted at http://pastebin.com/BjD84BQ3

Trigger warning: mention of suicidal ideation

tl;dr: I burned out as a developer at Amazon at the end of my second year. I’ve since found a healthy and sustainable work-life balance and enjoy work again. I write this to A) raise awareness, especially for new-hires and their families, and B) help give hope and advice to people going through the same at Amazon or other companies.

Hello, world

There’s been no shortage of anecdotes, opinions, and rebuttals regarding Amazon’s corporate culture as of late. I write this not to capitalize on the latest news-feed fad, but to share what I had already written and promptly deleted. I didn’t think anyone would want to hear my story, but it’s apparent people are going through a similar experience and don’t have a voice.

I’m a Software Development Engineer II at Amazon; SDE II basically means a software developer with at least 2–3 years of industry experience. I started at Amazon as an SDE I.