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
@transitive-bullshit
transitive-bullshit / auth-data.ts
Last active June 3, 2025 20:44
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
@tunnckoCore
tunnckoCore / AuthyToOtherAuthenticator.md
Created April 7, 2022 03:43 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the