Skip to content

Instantly share code, notes, and snippets.

View alexbosworth's full-sized avatar

Alex Bosworth alexbosworth

View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active April 17, 2024 12:32
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@AdamISZ
AdamISZ / SNICKER_BIP_draft.mediawiki
Last active April 3, 2023 20:09
SNICKER BIP draft


  BIP: ??
  Layer: Applications
  Title: SNICKER - Simple Non-Interactive Coinjoin with Keys for Encryption Reused
  Author&#58; Adam Gibson <AdamISZ@protonmail.com>
  Comments&#45;Summary&#58; No comments yet.
  Comments&#45;URI&#58; &#45;
  Status&#58; Proposed
  Type&#58; Informational
  Created&#58; &#45;

@ixdy
ixdy / yubikey4-ssh-macos.md
Last active April 12, 2024 20:19
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048
@arik-so
arik-so / schnorr_signature.js
Last active November 5, 2022 17:48
Schnorr Experimenting
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
const BigInteger = require('bigi');
const crypto = require('crypto');
const calculateHash = (R, P, message) => {
const hashPreimage = Buffer.concat([R.getEncoded(true), P.getEncoded(true), Buffer.from(message, 'utf-8')]);
return BigInteger.fromHex(crypto.createHash('sha256').update(hashPreimage).digest('hex')).mod(secp256k1.n);
};
@bretton
bretton / improved-lnd-bitcoind-install.md
Last active January 25, 2022 14:07
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet

2018-03-18: Updating of this guide is taking a backseat to the mainnet version at

Intro

This guide is specific to getting LND and bitcoind running on ubuntu 16.04 LTS for testnet.

It does not address mainnet, or using btcd, or neutrino.

Original installation guide:

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@pixelspark
pixelspark / Fallible.swift
Created June 3, 2015 18:02
Swift Fallible type
/**
FIXME: Box exists to prevent the "Unimplemented IR generation feature non-fixed multi-payload enum layout" error. */
final class Box<T> {
let value: T
init(_ value: T) {
self.value = value
}
}
@JaviSoto
JaviSoto / gist:292435381bb2e0d31402
Last active August 29, 2015 14:12
Functor and Monad in Swift blog post
@s-aska
s-aska / Keychain.swift
Last active September 16, 2022 03:37
Swift Keychain class ( supported Xcode 6.0.1 )
import UIKit
import Security
class Keychain {
class func save(key: String, data: NSData) -> Bool {
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ]