Skip to content

Instantly share code, notes, and snippets.

View gorango's full-sized avatar
👋
🌍

Goran gorango

👋
🌍
  • undefined
View GitHub Profile
@j4w8n
j4w8n / implement-user-api-keys-with-supabase.md
Last active April 18, 2025 16:45
Implement user API keys with Supabase

Implement user API keys with Supabase

This is pretty much my first crack at this. I'm sure things could be improved or done differently.

Rationale

JWTs are at the heart of Supabase authorization, but sometimes we wanna build an app that also gives users access via API keys; or perhaps only exclusively via API keys. As you may know, using JWTs as API keys makes them difficult to revoke and therefore a security issue.

We also want to ensure this doesn't significantly add to RLS polices, if at all.

Finally, we'd love to have this handled by Supabase and do as little as possible in our framework. This simplifies our code and reduces third-party libraries.

@sebastien-prudhomme
sebastien-prudhomme / src-app.hooks.js
Created April 20, 2020 18:25
Instrumenting FeathersJS with Prometheus
const prometheus = require('./hooks/prometheus')
module.exports = {
before: {
all: [prometheus()],
find: [],
get: [],
create: [],
update: [],
patch: [],
@homerjam
homerjam / authentication.js
Last active December 3, 2021 14:41
Nuxt/Feathers/Vuex SSR
const authentication = require('@feathersjs/authentication');
const jwt = require('@feathersjs/authentication-jwt');
const local = require('@feathersjs/authentication-local');
const oauth2 = require('@feathersjs/authentication-oauth2');
const session = require('express-session');
const Auth0Strategy = require('passport-auth0');
module.exports = function (app) {
const config = app.get('authentication');

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@adamreisnz
adamreisnz / package.json
Last active April 12, 2025 09:09
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@nitaku
nitaku / README.md
Last active September 17, 2023 11:05
Boolean operations on 2D shapes

This example shows the results (orange) of performing four different boolean operations (union, difference, xor and intersection) on two 2D shapes (blue). Thanks to the powerful clipper.js library, the computation is performed in client-side Javascript.

The example is almost entirely taken from this clipper.js demo.

@hofmannsven
hofmannsven / README.md
Last active April 1, 2025 06:51
Git CLI Cheatsheet
@bergie
bergie / .gitignore
Created September 19, 2011 15:50
Node.js email handling examples
config.json
reading-image.png