Skip to content

Instantly share code, notes, and snippets.

View gnat's full-sized avatar
:shipit:
ez pz lemon squeezy

Nathaniel Sabanski gnat

:shipit:
ez pz lemon squeezy
View GitHub Profile

CockroachDB, Docker Compose and Minio

This is the second in a series of tutorials on CockroachDB and Docker Compose.

You can find the first post here

  • Information on CockroachDB can be found here.
  • Information on Docker Compose can be found here
  • Information on Minio can be found here
  1. Add minio service to the docker-compose.yml file
@sloev
sloev / async_mysql.py
Last active May 3, 2021 19:07
asyncio sqlalchemy mysql
from sqlalchemy.pool import QueuePool
from sqlalchemy import create_engine
from contextlib import closing, contextmanager, ExitStack
from sqlalchemy.sql import text
import asyncio
import logging
import time
class AsyncMysqlDatabase:
@sinbad
sinbad / backup_gitea.sh
Created August 9, 2020 14:58
My Gitea Backup & Restore Scripts
#!/bin/bash
# `gitea dump` doesn't currently back up LFS data as well, only git repos
# It primarily backs up the SQL DB, and also the config / logs
# We'll backup like this:
# * "gitea dump" to backup the DB and config etc
# * tar / bzip all the repos since they will be skipped
# * Not rotated because git data is immutable (normally) so has all data
# * rsync LFS data directly from /volume/docker/gitea/git/lfs
# * No need for rotation since all files are immutable
@heytulsiprasad
heytulsiprasad / tailwind.js
Created September 4, 2020 17:55
Config tailwind to desktop first approach
module.exports = {
theme: {
extend: {},
screens: {
xl: { max: "1279px" },
// => @media (max-width: 1279px) { ... }
lg: { max: "1023px" },
// => @media (max-width: 1023px) { ... }

Restore a database from a userfile backup


CockroachDB supports enterprise grade backup and restore using object storage targets. For local development, a userfile scheme was introduced to allow fast prototyping without a heavy burden of spinning up costly infra. A customer requested ability to quickly validate whether they can recover from a complete tear down of a cluster without using object storage. This is my experience and current workaround to get this to work.


Related articles

@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active February 15, 2025 13:44
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
@gnat
gnat / trello_discord.md
Last active April 6, 2023 20:54
Trello notification to Discord webhook using trigger (NO zapier or bs)

NO ZAPIER!

Select Board

➡️ Automation

➡️ Rules

➡️ Create Rule

@alexbezhan
alexbezhan / laser.js
Created February 26, 2023 23:47
Laser.js - fast and small HTMX-like library
/**
* Principles:
* 1. Performance
* 2. Simplicity and debuggability.
*
* It's not trying to be:
* 1. Flexible.
*
* This results into the following:
* 1. Explicit attributes only
@gnat
gnat / project_layout.md
Last active April 10, 2025 12:55
General Project Layout

Why a base project layout?

  • ⭐ Works for many different project types: game, website, app.
  • /main lets us have supporting files excluded from Caddy, Godot, etc with zero extra config!
  • ⭐ Avoids industry jargon.

Use ideas you like, leave ideas you dislike. The intention is to be simple adaptable starting point.

Project Layout

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot