Skip to content

Instantly share code, notes, and snippets.

@crazyrabbitLTC
crazyrabbitLTC / GitReWrite
Created December 18, 2024 19:44
LLM Script to rewrite your Github History
import { exec } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs/promises';
import path from 'path';
import { z } from 'zod';
import OpenAI from 'openai';
import { zodResponseFormat } from 'openai/helpers/zod';
const execAsync = promisify(exec);
@khromov
khromov / service-worker.ts
Created April 10, 2023 21:17
SvelteKit service worker example
/// <reference types="@sveltejs/kit" />
/// <reference no-default-lib="true"/>
/// <reference lib="esnext" />
/// <reference lib="webworker" />
// https://kit.svelte.dev/docs/service-workers#type-safety
const sw = self as unknown as ServiceWorkerGlobalScope;
import { build, files, version } from '$service-worker';
@ardinusawan
ardinusawan / README.md
Last active September 21, 2025 10:22
JWE using JOSE with EdDSA algorithm in NodeJS

JWS & JWT using JOSE

How

  1. npm i jose

JWE using alg dir and A128GCM enc

node jwe.js

JWS using alg EdDSA and ed25519 enc

@pesterhazy
pesterhazy / building-sync-systems.md
Last active October 29, 2025 06:56
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

{
"UserInfo": {
"id": "#{USER_ID}",
"email": "#{USER_EMAIL}",
"first_name": "#{USER_FIRST_NAME}",
"last_name": "#{USER_LAST_NAME}",
"name": "#{USER_NAME}",
"picture": "#{USER_PROFILE_PICTURE}",
"roles": {
"#{ROLE_NAME}": "#{ROLE_ID}"
@reduardo7
reduardo7 / README.md
Last active December 15, 2024 01:00
DB with Revision History

DB with Revision History

First, you have only one table to handle everything, in order to keep the model design and the data integrity at only one point.

This is the basic idea, you can extend the design with the created_by & updated_by columns if you need.

The following implementation is for MySQL, but the idea can be implemented at other kind of SQL databases too.

Cons

@sastan
sastan / $layout.svelte
Last active February 5, 2025 09:46
sveltekit + urql (extended version)
<script context="module">
import { get, readable } from 'svelte/store'
import { createClient, operationStore } from '@urql/svelte'
import { browser, dev } from '$app/env'
/**
* @type {import('@sveltejs/kit').Load}
*/
@emilianavt
emilianavt / BestVTuberSoftware.md
Last active October 30, 2025 13:28
Best VTuber Software

Best VTuber software

This is a list of the most commonly used and relevant vtubing software. The "best" will always be subjective and depend on your specific requirements. Overall, the information in this list is as accurate as I could figure it out, but there might be errors or some details might become out of date. If you find anything that needs to be corrected, please let me know. You can also note it in a comment.

Additional explanations:

  • iPhone means that an iPhone is basically required
  • iFacialMocap support means that tracking data can be received from the iFacialMocap iPhone app
  • VMC protocol means that the application can send and/or receive tracking data from other VMC protocol capable applications, allowing the combination of multiple tracking methods (e.g. VSeeFace receiving VR tracking from Virtual Motion Capture and iPhone/ARKit face tracking from Waidayo)
  • Tobii means that the Tobii eye tracker is supported
@imDaniX
imDaniX / README Антимат.md
Last active September 12, 2025 09:36
Мат фильтр | Регулярка антимат

Регулярное выражение для нахождения русского мата в тексте. Использовать следует только для первичной модерации, ибо обходится нажатием в одну клавишу. Если вам требуется полноценный фильтра мата, советую прибегнуть к программному пути создания такового, найти третье API, или просто остановиться на ручной модерации.

Выражение писалось в первую очередь с оглядкой на регулярки Java - для других языков может потребоваться адаптация.

Основа регулярного выражения

\b(
((у|[нз]а|(хитро|не)?вз?[ыьъ]|с[ьъ]|(и|ра)[зс]ъ?|(о[тб]|п[оа]д)[ьъ]?|(.\B)+?[оаеи-])-?)?(
  [её](б(?!о[рй]|рач)|п[уа](ц|тс))|
  и[пб][ае][тцд][ьъ]
@mattlockyer
mattlockyer / jwt.js
Created November 2, 2019 04:01
JWT Token Module for Cloudflare Workers / Browser
/********************************
* Module for generating and verifying JWT tokens
* Designed to work on Cloudflare Workers
* Should work in the browser or any env that supports Web Crypto API
********************************/
/********************************
* Key secret is a random Uint8Array of length 64
* See below for instructions on generating random values / keys
********************************/