Skip to content

Instantly share code, notes, and snippets.

@dac09
dac09 / Monzo Webhooks + Fieldbook codelet integration
Last active October 1, 2016 15:18
Mondo Webhooks and fieldbook
Code to setup an integration between Mondo/Monzo webhooks and Fieldbook.
https://monzo.com/ and https://fieldbook.com
@jylopez
jylopez / stripe_country_codes.js
Last active April 12, 2025 00:10
Stripe Country Codes
[
{ code: 'AU', name: 'Australia' },
{ code: 'AT', name: 'Austria' },
{ code: 'BE', name: 'Belgium' },
{ code: 'BR', name: 'Brazil' },
{ code: 'BG', name: 'Bulgaria' },
{ code: 'CA', name: 'Canada' },
{ code: 'HR', name: 'Croatia' },
{ code: 'CY', name: 'Cyprus' },
{ code: 'CZ', name: 'Czech Republic' },
@Christopher-Hayes
Christopher-Hayes / slack-bolt.md
Last active December 23, 2024 10:45
Building a Serverless SlackBot with Bolt on Vercel - Things to Know

2024 Edit - In the comments, there are good alternatives. When this gist was written, there were few alternatives to the Slack Bolt package.

Some gotchas from my recent experience of building a serverless Next.JS + Bolt.JS Slack App on Vercel.

Note that if you're building an app that you want to distribute to other workspaces, AFAIK you need to build an API. So, Next.JS is used here to help with the public API. The alternative to an API is using "socket mode".

Slack API with Bolt must use /slack/events endpoint

  • When building out the API, Bolt ONLY uses the /slack/events endpoint. The Slack config settings will suggest you provide a different endpoint, like /slack/commands for Slash Commands. That would work if you weren't using the Node API (via Bolt), such as the Python API. However, Bolt uses the Node API which ONLY uses /slack/events for everything. You can still use Bolt functions app.command() and similar, just remember to put the /slack/events endpoint in the Slack config.
@t3dotgg
t3dotgg / try-catch.ts
Last active April 25, 2025 04:48
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;
};