Skip to content

Instantly share code, notes, and snippets.

View bartekus's full-sized avatar

Bartek Kus bartekus

View GitHub Profile
@drwasho
drwasho / P2P-lending-in-OpenBazaar.md
Last active December 13, 2017 17:47
A proposal for pseudonymous, peer-to-peer lending on OpenBazaar using Ricardian contracts and distributed collateralized trusts (dCT)

Peer-to-Peer Lending on OpenBazaar

0

Preamble

Banks are centralised institutions that, among other things, offer credit to individuals, groups and corporations. Historically, banks were a nexus of borrowers and lenders, matching the supply of liquidity to the demand for credit. The primary role of a bank was risk management in the form of the due diligence required to assess if a potential borrower was a worthwhile investment. With the advent of nation-state money printing and fractional-reserve banking, whereby money is lent into existence and losses are publicly subsidized by inflation and bailouts, the traditional care of risk management for loans has all but been obiliterated.

Peer-to-peer (P2P) lending has emerged as a means to decentralise the oligopolistic hold that banks possess in every category for lending. While P2P lending is still in early days, regulatory pressure is mounting making P2P lending

@rauschma
rauschma / PreventUnknownGet.js
Last active August 12, 2021 16:07
Prevent getting of unknown properties via ES6 proxies
// The following code is valid ECMAScript 6, but doesn’t work in Firefox, yet
function PreventUnknownGet() {
}
PreventUnknownGet.prototype = new Proxy(Object.prototype, {
get(target, propertyKey, receiver) {
if (!(propertyKey in target)) {
throw new TypeError('Unknown property: '+propertyKey);
}
// Make sure we don’t block access to Object.prototype
@jdforsythe
jdforsythe / mac-build-pgmodeler.md
Last active February 1, 2023 07:05
Build pgmodeler on Mac with Homebrew-installed pg and openssl

Building pgmodeler for Mac

Check requirements at https://pgmodeler.io/installation.

You will need Qt 5.9.x installed, full XCode installed, and homebrew installation of postgres and openssl.

The example below is v10.5 of PG and v5.9.6 of Qt, modify accordingly. Also, replace {{USERNAME}} with you Mac username.

The installation is the same as the instructions at the link above. There are a few path differences due to homebrew installation locations.

@undernewmanagement
undernewmanagement / docker-compose.yml
Created January 29, 2020 01:07
Pristine config for Traefik 2.0, Docker, and LetsEncrypt with sample container. Includes a HTTP to HTTPS redirect
version: '3'
services:
traefik:
container_name: traefik
image: traefik:v2.0
command:
- "--api.insecure=true"
- "--providers.docker=true"
@yosukehasumi
yosukehasumi / git-auto-deploy.md
Last active July 25, 2023 20:07
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy

Building pgModeler in MacOS with Homebrew

The official installation instructions for pgModeler recommends installing Xcode and the Enterprise DB distribution of Postgres to fulfill its build requirements. Luckily, Homebrew's got us covered!

  1. Checkout the source

    git clone https://github.com/pgmodeler/pgmodeler.git
    
@indexzero
indexzero / ISC.md
Created April 13, 2014 21:00
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@j4w8n
j4w8n / implement-user-api-keys-with-supabase.md
Last active April 10, 2024 09:28
Implement user API keys with Supabase

Implement user API keys with Supabase

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.

Solution

@FelixZY
FelixZY / supabase_api_auth.sql
Last active April 16, 2024 06:25
How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
-- Token Based API Access for Supabase
--
-- How to configure Supabase (https://supabase.com/) to generate and accept API tokens.
--
-- (c) 2022 Felix Zedén Yverås
-- Provided under the MIT license (https://spdx.org/licenses/MIT.html)
--
-- Disclaimer: This file is formatted using pg_format. I'm not happy with the result but
-- prefer to follow a tool over going by personal taste.
--