Skip to content

Instantly share code, notes, and snippets.

View andrewkmin's full-sized avatar
🤠

am andrewkmin

🤠
View GitHub Profile
@robertpainsi
robertpainsi / README.md
Last active November 13, 2024 08:04
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@benjamincharity
benjamincharity / autonomous.txt
Last active October 24, 2024 21:53
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@miguelmota
miguelmota / decode_example.js
Last active November 8, 2023 14:59
JavaScript decode RLP encoded Ethereum transaction (raw transaction) examples
// RLP encoded transaction
const rawTxHex = '0xed8205fc843b9aca00825208944592d8f8d7b001e72cb26a73e4fa1806a51ac79d88016345785d8a000080808080'
// using rlp package to decode values
const rlp = require('rlp')
const decoded = rlp.decode(rawTxHex)
console.log(decoded)
/*
[ <Buffer 05 fc>,
<Buffer 3b 9a ca 00>,
@brockelmore
brockelmore / pushable_array.sol
Created January 19, 2022 23:20
Pushable array datatype for solidity
// SPDX-License-Identifier: UNLICENSE
pragma solidity >=0.8.0 <0.9.0;
// NOT TESTED - USE AT YOUR OWN RISK
// Supports 32 byte word types. Could be easily extended to multiword types by
// passing in the size of the elements as well though
struct PushableArray {
@r-n-o
r-n-o / _README.md
Last active June 6, 2023 17:48
Bitcoin Address Derivation from Public Key

Bitcoin Address Derivation from Public Key

This gist shows how to derive a Bitcoin address using bitcoinjs-lib.

Context

Turnkey doesn't support Bitcoin address derivation yet, but it does give raw public keys. This means Bitcoin addresses can be derived on the client side. This code sample is provided as courtesy and should not be considered authoritative or production ready.

Any address derivation logic is critical because sending cryptocurrency to an address derived incorrectly can lead to permanent loss of funds. At minimum, any address derivation logic should be tested to make sure funds land on the derived deposit address correctly and that funds can be transferred back out without issues.

@r-n-o
r-n-o / README.md
Last active August 12, 2024 16:36
Passkeys, React Native, and Turnkey

Passkeys, React Native, and Turnkey

Back to the basics: what are passkeys again?

Passkeys are cryptographic key pairs generated and stored on secure hardware. Typically this is your Mac's secure enclave, your Android phone's Titan M2 chip, or a security key plugged in via USB.

  • Registration ("sign up") creates a new key pair
  • Authentication ("sign in") uses that key pair to sign a message with the private key

Why passkeys are different: they sync!