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
@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);
@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

@shobhitic
shobhitic / index.html
Created January 30, 2022 07:47
Wallet Connect Integration Code - https://youtu.be/Ws5jIo4NMDc
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Wallet Connect</title>
<script src="https://cdn.jsdelivr.net/npm/@walletconnect/web3-provider@1.7.1/dist/umd/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
</head>
<body>
// Head over to https://github.com/rigwild/anons-secret-nft :)
@mayankchoubey
mayankchoubey / deno_receive_complex_form_data.ts
Last active December 2, 2022 02:27
Deno vs Node: Multipart/form-data with fields and files
import {readerFromStreamReader, copy} from "https://deno.land/std/streams/mod.ts";
const basePath=Deno.env.get('TMPDIR');
const listener = Deno.listen({ port: 3000 });
for await(const conn of listener)
handleNewConnection(conn);
async function handleNewConnection(conn: Deno.Conn) {
for await(const { request, respondWith } of Deno.serveHttp(conn)) {
const reqBody=await request.formData();
@sindresorhus
sindresorhus / esm-package.md
Last active May 13, 2024 11:37
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.
@cryptoscopia
cryptoscopia / dydxFlashLoanTemplate.sol
Created October 21, 2020 06:42
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }