Skip to content

Instantly share code, notes, and snippets.

View nboire's full-sized avatar

Nicolas BOIRE nboire

View GitHub Profile
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@jbesw
jbesw / index.js
Last active March 24, 2023 07:07
Language translation with S3 and AWS Translate
/*
MIT No Attribution
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS Api Gateway to SNS topic
Resources:
StatsApiGateway:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
@dbisso
dbisso / 10_blackfire_repo.config
Last active February 1, 2023 15:12
Set up Blackfire on AWS Elastic Beanstalk
commands:
01_add_blackfire_repo:
command: "sudo yum install -y pygpgme && wget -O - 'http://packages.blackfire.io/fedora/blackfire.repo' | sudo tee /etc/yum.repos.d/blackfire.repo"
@IvanSanchez
IvanSanchez / L.TileLayer.ServiceWorker.js
Created October 30, 2015 14:40
Preview of L.TileLayer.ServiceWorker.js
if ('serviceWorker' in navigator && !this.hasOwnProperty('ServiceWorkerGlobalScope')) {
var ownUrl = new URL(document.currentScript.src);
// Before the worker inits, keep tileserver URLs temporarily here
var oldTileLayerProto = L.extend({}, L.TileLayer.prototype);
L.TileLayer._urlsToWatch = [];
L.TileLayer.prototype.initialize = function(url, options) {