Skip to content

Instantly share code, notes, and snippets.

View Xetera's full-sized avatar

Xetera

View GitHub Profile
@Xetera
Xetera / supabase_dump.md
Last active November 25, 2025 14:28
Dumping from supabase and restoring on local postgres

Restoring a supabase dump to local postgres

Supabase contains a ton of extra schemas, roles and extensions that prevents restoring a local db from a supabase db. There are some tools out there but thery're all tedious to use. Here's how you can do it with a single pg_dump command

pg_dump --exclude-schema graphql --exclude-schema auth --exclude-schema graphql_public \
  --exclude-schema pgsodium --exclude-schema pgbouncer --exclude-schema storage \
  --exclude-schema realtime --exclude-schema vault --exclude-extension pgsodium \
 --exclude-extension pg_graphql --exclude-extension supabase_vault \
@Xetera
Xetera / gyazo_hydration.go
Created November 14, 2025 15:43
Gyazo's PRO data export does NOT properly include the created at field for the images you download. This script restores that data back into the images given they're all in the same folder and that you have an api key.
// Yes this is vibe coded. It worked fine for me
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
@Xetera
Xetera / xseed-sonarr.py
Created February 16, 2024 00:54
Script for hardlinking usenet imports in sonarr into a separate folder with its original download name
#! /usr/bin/env python3
import requests
import os
import pathlib
SONARR_TOKEN = os.environ.get("SONARR_TOKEN")
# directory where hardlinks will be created for renaming purposes
HARDLINK_TARGET = os.environ.get("HARDLINK_TARGET")
# DRY_RUN=true to test without touching the filesystem
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
@Xetera
Xetera / xseed-usenet.py
Last active June 26, 2025 08:21
A cross-seeding script to go through radarr's import history and hardlink movies downloaded from usenet with their original titles
#! /usr/bin/env python3
import requests
import os
import pathlib
RADARR_TOKEN = os.environ.get("RADARR_TOKEN")
# directory where hardlinks will be created for renaming purposes
HARDLINK_TARGET = os.environ.get("HARDLINK_TARGET")
# DRY_RUN=true to test without touching the filesystem
DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true"
@Xetera
Xetera / mask.js
Created August 3, 2023 10:25
Mask sensitive values in an entire json file in github actions
const file = await import(process.argv[2], { assert: { type: "json" } })
function getValues(obj) {
const values = []
if (typeof obj !== "object") {
return values
}
for (const key of Object.keys(obj)) {
if (typeof obj[key] === "object") {
@Xetera
Xetera / spotify_image_size.ts
Created April 19, 2023 08:14
Function for converting between spotify album art sizes in-memory
const MagicImageBytes = {
640: 0b1011001001110011n,
300: 0b0001111000000010n,
64: 0b0100100001010001n,
} as const;
/**
* Converts a spotify link to a new size.
*
* @see
@Xetera
Xetera / ivd-autofill.js
Last active January 25, 2024 20:40
Interaktif Vergi Dairesi Otomatik Ödeme Scripti
const CARD_NUMBER = "1234123412341234"
const CARD_OWNER = "John Doe"
const CARD_CVV = 999
const CARD_EXPIRY = "3/26"
// Change above this line
function typeString(elementId, str, callback) {
let element = document.getElementById(elementId)
if (!element) {
@Xetera
Xetera / kahve_dunyasi.json
Created October 19, 2022 22:01
List of all Kahve Dunyasi locations around the world
[
{
"storeId": "d1d14969-c3e3-e711-80e0-005056010583",
"storeName": "Kahve Dünyası - Promenade",
"storeCode": "509",
"city": "HAWALLİ",
"state": "AL KUWAİT",
"district": "AL MOTASEM STREET",
"country": "KUVEYT",
"address": "Inside The Sultan Center, Al Motasem Street, Al Kuwait Hawalli",
@Xetera
Xetera / ban_check.py
Created September 18, 2022 14:29
Python function for checking when a site was banned by the Turkish government
from typing import Optional
import requests
import re
import datetime
def check_turkish_ban_date(site: str) -> Optional[datetime.date]:
"""
Looks up when a site (domain + tld) was banned in turkey.
Returns None if the site isn't banned.
@Xetera
Xetera / armongate.geojson
Last active September 5, 2022 05:28
All MAC Fitness locations in Turkey
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.