Skip to content

Instantly share code, notes, and snippets.

@DanGould
DanGould / Serverless_Payjoin.mediawiki
Last active November 1, 2023 20:07
Serverless Payjoin - Receive surveillance-busting bitcoin transfers without hosting a secure endpoint


  BIP: ???
  Layer: Applications
  Title: Payjoin Version 2: Serverless Payjoin
  Author&#58; Dan Gould <d@ngould.dev>
  Status&#58; Draft
  Replaces&#58; 78
  Type&#58; Standards Track
  Created&#58; 2023&#45;08&#45;08
  License&#58; BSD&#45;2&#45;Clause

@kdmukai
kdmukai / op_return.py
Last active June 13, 2023 00:24
Adding an OP_RETURN output to a psbt using `embit`
"""
dependency: pip install embit
"""
from embit import compact
from embit.psbt import PSBT, OutputScope
from embit.script import Script
class OPCODES:
OP_RETURN = 106
OP_PUSHDATA1 = 76
#cloud-config
# This is the user-data configuration file for cloud-init. By default this sets
# up an initial user called "ubuntu" with password "ubuntu", which must be
# changed at first login. However, many additional actions can be initiated on
# first boot from this file. The cloud-init documentation has more details:
#
# https://cloudinit.readthedocs.io/
#
# Some additional examples are provided in comments below the default
@haproxytechblog
haproxytechblog / haproxy-config-2-1.cfg
Created December 2, 2019 23:22
HAProxy 2.1 Sample Config
#
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
#
# Have questions? Check out our community Slack:
# https://slack.haproxy.org/
#
@mnot
mnot / http.rrtext
Last active November 11, 2019 03:22
Railroad diagrams of HTTP semantics
# Generated from the ABNF at <https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#collected.abnf>
# using <https://github.com/katef/kgt>
Accept:
,---------------------------------------------------------------------------------------------------------------------------.
| |
||--^--v----------------- "," ------------------>--v------------------------------------------------------------------------->-->--||
| | | |
| ,-------------------. | | ,-----------------------------------------------. |
| | | | | | | |
@den-crane
den-crane / AggregatingMergeTree-event-enrichment
Last active May 8, 2024 10:57
AggregatingMergeTree-event-enrichment
CREATE TABLE states_raw(
d date,
uid UInt64,
first_name String,
last_name String,
modification_timestamp_mcs DateTime64(3) default now64(3)
) ENGINE = Null;
CREATE TABLE final_states_by_month(
d date,
@den-crane
den-crane / CH-event-sourcing-using-AggregatingMergeTree
Last active December 29, 2023 02:02
event sourcing using AggregatingMergeTree
DROP TABLE IF EXISTS states_raw;
DROP TABLE IF EXISTS final_states_by_day;
DROP TABLE IF EXISTS final_states_by_day_mv;
CREATE TABLE states_raw
(
process String,
state String,
stateint Int64,
statevalue Float64,
@Ocramius
Ocramius / Caddyfile
Last active March 11, 2024 22:14
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}
@rraval
rraval / postgres-collation.md
Last active December 6, 2023 16:25
PostgreSQL collation is a massive footgun

This is a slightly stripped down version from our internal bug tracker. The point of posting this publicly is part FYI, part peer review. I'm hoping someone can look at this, disagree, and tell me all the downsides of using the C locale or point out things I've misunderstood. The Recommendations section in particular is contextualized by our database serving a SaaS product for users from many different locales, thus making locale a render level concern. YMMV, caveat emptor, etc.


Collation defines the character ordering for textual data. For Postgres, https://www.postgresql.org/docs/current/static/locale.html:

The locale settings influence the following SQL features:

  • Sort order in queries using ORDER BY or the standard comparison operators on textual data
  • The upper, lower, and initcap functions
@jimmywarting
jimmywarting / readme.md
Last active May 24, 2024 10:14
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers