Skip to content

Instantly share code, notes, and snippets.

@adtac
adtac / Dockerfile
Last active November 1, 2024 03:05
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@brandonros
brandonros / stripe.js
Last active July 6, 2019 21:25
Easiest node.js Stripe API implementation I could come up with
const rp = require('request-promise-native')
const apiRequest = (uri, form) => {
return rp.post({
uri,
form,
json: true,
headers: {
authorization: `Basic ${Buffer.from(`${process.env.STRIPE_API_KEY}:`).toString('base64')}`
}
@ecarreras
ecarreras / README.md
Last active August 7, 2023 07:39
PostgreSQL replication

Checklist

  • Create user replication in the master
sudo -u postgres psql -c "CREATE USER rep REPLICATION \
LOGIN ENCRYPTED PASSWORD 'thepassword';"
  • Modify postgresql.conf in the master
listen_address = # make sure we're listening as appropriate
wal_level = hot_standby