Skip to content

Instantly share code, notes, and snippets.

View davidfurlong's full-sized avatar
👨‍💻

David Furlong davidfurlong

👨‍💻
View GitHub Profile
import { Context, HonoRequest, Next } from "hono";
import { validateFramesPost } from "@xmtp/frames-validator";
export const xmtpSupport = async (c: Context, next: Next) => {
await next();
const isFrame = c.res.headers.get("content-type")?.includes("html");
if (!isFrame) return;
if (!(await isXMTP(c.req))) return;
@whatrocks
whatrocks / fling.md
Last active October 8, 2023 15:42
fling pattern on Farcaster

fling ⌆

The fling pattern is a constraint on the Farcaster protocol which allows you to keep a daily log of your work, while benefitting from all the great social features of Farcaster.

Inspiration

  • John Carmack's .plan files
  • OhLife.com (now defunct startup that emailed you 1x a day with "How did your day go?")

Constraints

@payton
payton / README.md
Last active April 23, 2023 22:02
Set up Hubble on EC2 with CloudFormation

Set up Hubble on EC2 with CloudFormation

Instructions

  1. Create new stack with one click or use the provided stack.yaml template (Use a Goerli eth endpoint and leave all other configurations default)
  2. Connect to your EC2 instance
    1. Go to the resources tab
    2. Select your EC2 instance
    3. Go to your EC2 instance's primary page
@dsafreno
dsafreno / firebase-hook.js
Created January 14, 2020 16:52
React Hooks for loading Firebase Data
import React, { useReducer, useEffect, useRef } from 'react';
import firebase from 'firebase/app';
import equal from 'deep-equal';
function filterKeys(raw, allowed) {
if (!raw) {
return raw;
}
let s = new Set(allowed);
return Object.keys(raw)
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

/*
useful references:
String.prototype.replace()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
https://alligator.io/js/string-replace/
Encode and Decode HTML entities using pure Javascript
https://ourcodeworld.com/articles/read/188/encode-and-decode-html-entities-using-pure-javascript
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
#!/bin/bash
# Logout current GitHub credentials and remove global user.name, user.email
echo -e "host=github.com\nprotocol=https\n" | git credential-osxkeychain erase
git config --unset-all --global user.name
git config --unset-all --global user.email