Skip to content

Instantly share code, notes, and snippets.

@storeman
storeman / php_unserialize_to_json.sql
Last active September 24, 2024 08:49
PHP unserialize in Postgresql to json
/**
Decode a php serialized value to json. This function only supports basic
data types:
- arrays (will always become a json object)
- booleans
- integers
- floats
- strings
- NULL
The php_unserialize(text) function is a helper function which extracts the first value

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@fetis
fetis / kmb.md
Last active December 4, 2020 12:38
КМБ мамкиного инвестора

КМБ мамкиного инвестора

Курс от Тиькофф Журнала про инвестиции. Про основы основ.
https://journal.tinkoff.ru/pro/invest/

Курс "Финансовые рынки и институты" от ВШЭ (2014). Примеры немного старые, но теоретическая информация подробная.
https://www.coursera.org/learn/finansovye-rynki/home/info

Курсы по экономике на Khan Academy (непроверено)
https://www.khanacademy.org/economics-finance-domain

@khalidx
khalidx / node-typescript-esm.md
Last active December 26, 2025 00:21
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@marcan
marcan / fedora-autorestic.md
Last active June 28, 2025 14:19
Setting up autorestic on Fedora (Asahi) for automated backups with btrfs
  • Install restic and autorestic
  • sudo mkdir -p /var/cache/restic
  • Set up /etc/autorestic.yml roughly as follows:
backends:
    mybackend:
        # Your backend options here, see the documentation
global:
    all:
        cache-dir: /var/cache/restic