Skip to content

Instantly share code, notes, and snippets.

@fiftin
fiftin / Convert PostgreSQL to SQLite
Created October 5, 2015 07:04
Convert PostgreSQL to SQLite
1. Dump the data only sql to file
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql
2. scp to local
3. Remove the SET statements at the top
such as:
SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
4. Remove the setval sequence queries
@a1ip
a1ip / youtube-video-thumbnails-sizes-and-formats.md
Created April 7, 2020 18:53
YouTube video thumbnails sizes and formats

Note: YouTube is serving thumbnails from 2 servers:

  • //img.youtube.com
  • //i.ytimg.com

Examples are with //i.ytimg.com server just because it’s shorter, no other particular reason. You can use both.

  • Player Background Thumbnail (480x360):

@omltcat
omltcat / caddy_labels.md
Last active July 14, 2025 22:03
Caddy with Docker Labels: Easy config for wildcard certs and Authelia

What is this?

One great feature of caddy-docker-proxy is that you can quickly define config rules with Docker Compose labels in each containers on the fly like Traefik, instead of at a centralized place. With this feature, we can define everything in compose files, and don't ever need to mess with a config file (Caddyfile or JSON).

Taking advantage of snippets, I created this docker-compose.yaml example so that you can quickly define routing rules and add authetication like Authelia with just 3 lines of labels below each docker container you use.

With this example, should not ever need to manually edit Caddyfile config.

When you add a new container, you just need to do this:

networks:
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active July 14, 2025 22:02
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@noamtamim
noamtamim / README.md
Last active July 14, 2025 21:59
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

@en4rab
en4rab / CF-U1-BIOS.md
Last active July 14, 2025 21:54
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://www.ami.com/support-other/ Click on Aptio 4 AMI Firmware Update Utility

Sui Move instructions (.move files):
- Sui is an object-oriented blockchain. Sui smart contracts are written in the Move language.
- Sui's object ownership model guarantees that the sender of a transaction has permission to use the objects it passes to functions as arguments.
- Sui object ownership model in a nutshell:
- Single owner objects: owned by a single address - granting it exclusive control over the object.
- Shared objects: any address can use them in transactions and pass them to functions.
- Immutable objects: like Shared objects, any address can use them, but they are read-only.
@NormalDuck
NormalDuck / replication.test.ts
Last active July 14, 2025 21:54
Roblox-TS Jecs component based replication
/* eslint-disable max-lines -- unit testing*/
import { Flamework } from "@flamework/core";
import { pair, Wildcard, world } from "@rbxts/jecs";
import { beforeEach, describe, expect, it, jest } from "@rbxts/jest-globals";
import { Trove } from "@rbxts/trove";
import { Handle } from "../constants/world";
import components from "../ecs/components";
import type { ReplicationSnapshot } from "../ecs/replication";
import { startReplication, startSnapshots } from "../ecs/replication";

Code Generation

Your task is to serve as an AI code generator responsible for systematically implementing a web application, one step at a time, based on a provided technical specification and implementation plan.

You will:

  1. Identify which step in the plan is next.
  2. Write or modify the code files necessary for that specific step.
  3. Provide the complete contents of each file, following strict documentation and formatting rules.
@Chubek
Chubek / POSIX-Shell.ebnf
Last active July 14, 2025 21:52
The POSIX Shell Grammar
# Lexical and Syntactic EBNF Grammar for POSIX Shell (Non-Attributed)
# Authored by Chubak Bidpaa (chubakbidpaa@riseup.net)
# Written For the Marsh Shell (https://github.com/Chubek/Marsh)
# This grammar is based on POSIX specs (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
# This document is released under `Unlicense` Public Domain License Agreement | (C) 2024 Chubak Bidpaa | No Warranty
# A: Lexical Grammar for POSIX Shell