Skip to content

Instantly share code, notes, and snippets.

@gregdingle
gregdingle / digikeyManufacturerList.json
Created July 15, 2021 22:27
Digikey manufacturer IDs for use with Digikey API
{
"Optiks Mechatronics Pvt. Ltd.": [3719],
"3G Shielding Specialties": [2276],
"3M": [19, 1067, 8002, 1717, 2089],
"4D Systems": [1613, 2114],
"5G Hub": [3082],
"A&D Engineering": [3715],
"Aavid": [59, 1061, 8101],
"ABB Embedded Power": [555, 8012, 235],
"ABLIC U.S.A. Inc.": [1662],
@zanona
zanona / sentry-serverless-firebase.ts
Last active June 8, 2024 21:11
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';
@adamkl
adamkl / AppContextProvider.tsx
Created February 10, 2020 22:20
xState service layer
import React from "react";
import { createUserSessionService } from "services/UserSessionService";
import { createNavService } from "services/NavService";
// Wiring up our "IOC container"
const userSessionService = createUserSessionService();
// NavService depends on UserSessionService
const navService = createNavService(userSessionService);
@jboner
jboner / latency.txt
Last active June 29, 2024 19:54
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD