Skip to content

Instantly share code, notes, and snippets.

View 2color's full-sized avatar
🎁
Building

Daniel Norman 2color

🎁
Building
View GitHub Profile
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active March 31, 2025 09:48
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active April 2, 2025 17:54
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@gmelodie
gmelodie / gh-get-team-ssh-keys.sh
Created July 4, 2022 18:59
Get SSH keys for all the members of a github team
APITOKEN="" # TODO: add your token here (create one: https://github.com/settings/tokens)
# be sure to check if the token hasn't expired!
# for ORG and TEAM, you can get those by navigating to your team on github
# and seeing the url, which will be in the format:
# https://github.com/orgs/{ORG}/teams/{TEAM}/discussions
# e.g. https://github.com/orgs/application-research/teams/a-team/discussions
@mig5
mig5 / ipfs-folder-and-files-publish-poc.py
Last active May 4, 2024 04:00
A PoC showing how to publish a folder containing files to IPFS via Python using requests module
#!/usr/bin/env python3
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The author
# accepts no responsibility for its use, of which you do so at
# your own risk.
import json
import requests

Addressing feedback from this Gist.

Pagination. Looks like limited to paginate by id. I wanted to paginate by a date field and felt impossible

In the most recent Preview version, (cursor-)pagination can be done by any unique field or combination of fields. For example:

model Post {
  id        Int     @id @default(autoincrement())
  title     String
@tj
tj / app.js
Last active October 4, 2021 19:38
const http = require('http')
const rpc = require('./rpc')
/**
* Pets service.
*/
class Pets {
constructor(db = []) {
@onpaws
onpaws / manifests.yaml
Created May 12, 2019 13:59
Fixed manifests for parity 2.5.0
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: default
name: pv-default-100g-disk01
annotations:
volume.beta.kubernetes.io/storage-class: default
spec:
accessModes:
- ReadWriteOnce
@swyxio
swyxio / .gitignore_global
Last active December 29, 2024 12:07
my dotfiles - more info here https://www.swyx.io/new-mac-setup
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
.vscode
.idea
Thumbs.db
# used to need to run git config --global core.excludesfile ~/.gitignore_global to set this but apparently no longer needed https://x.com/bate5a55/status/1840594630972191118
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 3, 2025 00:50 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,