Skip to content

Instantly share code, notes, and snippets.

View NikolaRusakov's full-sized avatar
🌏
Working from Anywhere

Nikola Rusakov NikolaRusakov

🌏
Working from Anywhere
  • Doto Solutions
  • Queensland, Australia
View GitHub Profile
@xinha-sh
xinha-sh / client.ts
Last active June 27, 2025 17:21
Expo auth implementation using SST Auth V2
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { type JSONWebKeySet, createLocalJWKSet, errors, jwtVerify } from "jose";
import {
InvalidAuthorizationCodeError,
InvalidRefreshTokenError,
InvalidSessionError,
} from "./error";
import { generatePKCE } from "./pkce";
import type { SubjectSchema } from "./session";
@prutya
prutya / sst.config.ts
Last active October 21, 2025 12:57
Deploy a Next.js app to a Hetzner VPS using SST and Docker (Part of my SST guide https://www.prudkohliad.com/articles/deploy-next-js-to-vps-using-sst-2024-08-11). See full repo at https://github.com/prutya/next-self-hosted
/// <reference path="./.sst/platform/config.d.ts" />
import { resolve as pathResolve } from "node:path";
import { writeFileSync as fsWriteFileSync } from "node:fs";
import { asset as pulumiAsset, all as pulumiAll } from "@pulumi/pulumi";
// Specify HCLOUD_TOKEN and CLOUDFLARE_API_TOKEN before running
// Permissions for CLOUDFLARE_API_TOKEN:
// - Account Settings:Read
// - Zone Settings:Edit
@promto-c
promto-c / sqlite_schema_to_dbml.py
Created May 29, 2024 06:32
This Python script converts the schema of an SQLite database to DBML format. It exports the table definitions and foreign key relationships, allowing for easy visualization of the database structure using tools like dbdiagram.io.
"""
Copyright (C) 2024 promto-c
Permission Notice:
- You are free to use, copy, modify, and distribute this software for any purpose.
- No restrictions are imposed on the use of this software.
- You do not need to give credit or include this notice in your work.
- Use at your own risk.
- This software is provided "AS IS" without any warranty, either expressed or implied.
"""
@axelbdt
axelbdt / install_asdf_with_nix.md
Created April 11, 2023 14:10
How to Install asdf with Nix Home-manager

How to Install asdf with Nix Home-manager

  1. First, add asdf to the Nix configuration with the package named asdf-vm. Add the following line to your configuration.nix file:

    environment.systemPackages = with pkgs; [
      asdf-vm
    ];
@mitchellh
mitchellh / overlay.nix
Last active November 2, 2024 22:01
Playdate SDK on Nix on aarch64
let
# Playdate distributes their SDK as precompiled x86_64 binaries
# currently so we have to import cross-compiled packages for it
# if we're not on an x86_64 system.
pkgsIntel = import <nixpkgs> {
crossSystem = {
config = "x86_64-unknown-linux-gnu";
};
};
in
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; BACK UP YOUR LOGSEQ DIR BEFORE RUNNING THIS!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright (C) Aug 4 2022, William R. Burdick Jr.
;;
;; LICENSE
;; This code is dual-licensed with MIT and GPL licenses.
@matthewpi
matthewpi / README.md
Last active November 10, 2025 05:30
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

Note

This gist has graduated to a proper repo: preactjs/preact-root-fragment

preact-root-fragment: partial root rendering for Preact

This is a standalone Preact 10+ implementation of the deprecated replaceNode parameter from Preact 10.

It provides a way to render or hydrate a Preact tree using a subset of the children within the parent element passed to render():

@sindresorhus
sindresorhus / esm-package.md
Last active December 10, 2025 13:22
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@willangley
willangley / tailscale-keep
Last active March 5, 2024 18:16
tailscale config for OpenWRT
/etc/init.d/tailscale
/etc/rc.d/*tailscale
/etc/tailscale/
/lib/upgrade/keep.d/tailscale
/usr/sbin/tailscale
/usr/sbin/tailscaled