Skip to content

Instantly share code, notes, and snippets.

View tunnckoCore's full-sized avatar
🔒
Fighting for freedom, security and privacy 🔐

Charlike Mike Reagent tunnckoCore

🔒
Fighting for freedom, security and privacy 🔐
View GitHub Profile
import { drizzle } from 'drizzle-orm/node-postgres'
import { desc, asc, eq } from 'drizzle-orm'
import { numbersTable } from '~/db/schema'
// Type definitions to match Convex patterns
type TableName = 'numbers'
type OrderDirection = 'asc' | 'desc'
// Table mapping - extend this as you add more tables
const tableMap = {
@transitive-bullshit
transitive-bullshit / auth-data.ts
Last active July 9, 2025 04:10
Example of how to use Drizzle Postgres as a storage adaptor with OpenAuth
import { jsonb, pgTable, text, timestamp } from 'drizzle-orm/pg-core'
// Simple key-value store of JSON data for OpenAuth-related state.
export const authData = pgTable('auth_data', {
// Example ID keys:
// "oauth:refresh\u001fuser:f99d3004946f9abb\u001f2cae301e-3fdc-40c4-8cda-83b25a616d06"
// "signing:key\u001ff001a516-838d-4c88-aa9e-719d8fc9d5a3"
// "email\[email protected]\u001fpassword"
// "encryption:key\u001f14d3c324-f9c7-4867-81a9-b0b77b0db0be"
id: text().primaryKey(),

If it's so easy to guess a uuid, here you go

I ran crypto.randomUUID() twice on my machine.

The first ID was 15041508-fd38-4eda-bc1d-7b74e4738cd9

The second? That's your challenge.

I encrypted a text file with the following command:

@ZigBalthazar
ZigBalthazar / UTXO.ts
Created March 9, 2024 15:56
implementatiton of UTXO in typescript
type UTXO = {
id: string;
amount: number;
};
type Wallet = {
address: string;
utxos: UTXO[];
};

New (old) Way of Trading.

I think I solved the problem of safe #Ethscriptions trading.

A multi step process, but safe and sane. Basically, offers-based.


1/ Here's how it could work:

@sherbakovdev
sherbakovdev / InscriptionButton.tsx
Created April 29, 2023 17:40
useOrdinalSafe React hook. Connect to a React app to make inscriptions.
"use client";
import * as React from "react";
import { useOrdinalSafe } from "@/hooks/useOrdinalSafe";
type Props = {
data: string;
};
@tunnckoCore
tunnckoCore / BurnLotto.sol
Last active April 25, 2023 23:42
A Solidity v0.8 lottery contract. In 150 lines. Called BurnLotto, because players deposit an ERC20 burnable tokens, and a winner is chosen randomly when round is finished - x% of deposited tokens are burned, the rest are transferred to the winner. Apache-2.0 licensed.
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.18;
// Created by @tunnckoCore / @wgw_eth / wgw.eth
interface IERC20Burnable {
function burn(uint256 value) external;
function balanceOf(address account) external view returns (uint256);
@JacobWeisenburger
JacobWeisenburger / makeSearchParamsObjectSchema.ts
Last active April 19, 2025 19:41
a way to parse URLSearchParams with Zod
import { z } from 'zod'
function safeParseJSON ( string: string ): any {
try { return JSON.parse( string ) }
catch { return string }
}
function searchParamsToValues ( searchParams: URLSearchParams ): Record<string, any> {
return Array.from( searchParams.keys() ).reduce( ( record, key ) => {
const values = searchParams.getAll( key ).map( safeParseJSON )
@mlafeldt
mlafeldt / clerk.ts
Created August 25, 2022 09:51
Talking to Clerk's backend API from Deno
#!/usr/bin/env -S deno run --allow-env=CLERK_API_KEY --allow-net=api.clerk.dev --no-check
import {
ClerkAPIResponseError,
ClerkBackendAPI,
User,
} from "https://cdn.skypack.dev/@clerk/backend-core?dts";
const ClerkAPI = new ClerkBackendAPI({
apiClient: {
@JonhSHEPARD
JonhSHEPARD / install-copilot.sh
Last active August 20, 2023 00:45
Github Copilot on NixOS
#!/bin/sh
if [ "$EUID" -ne 0 ]
then echo "This script must be run as root"
exit
fi
if [ "$#" -ne 1 ]; then
echo "Usage: ./$0 <path-to-ide"
exit 1