Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@umanghome
umanghome / publish.yml
Last active January 12, 2025 18:37
GitHub Action: Generate a build and push to another branch
# .github/workflows/publish.yml
name: Generate a build and push to another branch
on:
push:
branches:
- master # Remove this line if your primary branch is "main"
- main # Remove this line if your primary branch is "master"
jobs:
@btamayo
btamayo / README.md
Created June 12, 2020 05:09 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@ColdGrub1384
ColdGrub1384 / README.md
Last active June 3, 2020 23:46
UIKit views on PytoUI

objc_view

This is a small module for building pyto_ui views with UIKit. Here is an example with UIDatePicker.

import objc_view as ov
from UIKit import UIDatePicker
from datetime import datetime
from typing import Callable
import pyto_ui as ui
@lordlycastle
lordlycastle / Create Disk Image.applescript
Last active September 27, 2024 18:28
This AppleScript creates a disk image (.dmg) with the given files/folders user provides.
set fileType to display dialog "Create disk image of a " buttons {"Folder", "File", "Cancel"} ¬
default button ¬
"Folder" cancel button ¬
"Cancel" with title "Create Disk Image"
if button returned of fileType is "Folder" then
set input to choose folder with prompt "Choose folder to make disk image of:"
else if button returned of fileType is "File" then
set input to choose file with prompt "Choose file to make disk image of:"
end if
@RubenSomsen
RubenSomsen / Resources.md
Last active October 10, 2024 14:25
Links to my work, accessible via tiny.cc/somsen

Introduction

I'm Ruben Somsen, Bitcoin Sorcerer. I do protocol design in order to enhance Bitcoin.

I'm sponsored by Spiral, Superlunar/Gemini, HRF, and am currently working on Silent Payments with Josie and assisting Davidson with the implementation of Proof-of-Work fraud proofs into Floresta.

I also help maintain the bitcoin-dev mailing list, am a BIP editor, co-hosted the Unhashed Podcast, founded the Seoul Bitcoin Meetup in 2014, actively co-organizing BitDevs Amsterdam, and on the layer two funding sub-committee of OpenSats.

You can find me on Twitter, Mastodon, and Telegram. You can also join [this Te

@ariard
ariard / digital-card.txt
Created May 6, 2020 16:56
Celebrating the 1-year of Bitcoin PR Review Club
jonatack:
U2FsdGVkX18XDMZfMBvtOjbdzP9FglsfNI1IkmfUsmjhUJc1x8YghQL9jjBRA22G
LMC9KLt7L/7sFJfVm7rEW+yeoWXL6S/K1NWdOvoy6O5pfQF2NMltA6Mzb1q4huVM
x+BW7DNEBF9nDknRwFiAD079WOvLyLbWvPHk1FJp9hW5qRgU/629/XQ0pQX1eqdf
OLVS5AGuTxBgc8AE6tp4i+x7mC037bTBuI9c6X4mngfYpfu9PkSK+DzQx6pXqgTh
uvEprusb8PzsWmUSNbFN4umr9bAbUeezWig7mWNbIEbpBR/jD4YSeTXaBXfP2fvB
BJU/38DWll06Ki46CE/tkTMSjuUg2E5T2hTDppSAC9j6OuhLtt8+ZKLtt2X2tCm8
vdERbOHFdZu/Npsj6vLg8SWsKoen5LvGbRWfuXTWEa9FlTu9t7PMbcc5Zbk/5DKr
yY3jW/4u/bWuZlYca3U8dSZEjGZod+paht4acXoJRUy58RWl3Lg72FZXCuzw7Ph2
PUSH(3) [50dd09] OP_CHECKLOCKTIMEVERIFY OP_DROP PUSH(33) [03fd586bbc9fdf11ca183d62c764e9f71b2eba8ded13621f8204cc8bc63123ffb1] OP_CHECKSIG OP_IF 1 OP_ELSE PUSH(3) [d0a70a] OP_CHECKLOCKTIMEVERIFY OP_DROP PUSH(33) [0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798] OP_CHECKSIG OP_ENDIF
Witness script: 0350dd09b1752103fd586bbc9fdf11ca183d62c764e9f71b2eba8ded13621f8204cc8bc63123ffb1ac63516703d0a70ab175210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac68
Address: tb1qtxuf75rjgldlsx0u5fpxw3ntyu7kqvtl9rj3yfhw3vygshswurcq5mnzq5
@mutatrum
mutatrum / halving.sh
Last active January 26, 2021 00:02
Get estimated halving date from a bitcoin node
#!/bin/bash
CURRENT_BLOCK="$(bitcoin-cli getblockcount)"
CURRENT_BLOCK_HASH="$(bitcoin-cli getblockhash $CURRENT_BLOCK)"
CURRENT_BLOCK_TIME="$(bitcoin-cli getblock $CURRENT_BLOCK_HASH | jq '.mediantime')"
HALVING_BLOCK="$(((($CURRENT_BLOCK/210000)+1)*210000))"
BLOCK_DELTA="$(($HALVING_BLOCK-$CURRENT_BLOCK))"
PREVIOUS_BLOCK="$(($CURRENT_BLOCK-$BLOCK_DELTA))"
PREVIOUS_BLOCK_HASH="$(bitcoin-cli getblockhash $PREVIOUS_BLOCK)"
PREVIOUS_BLOCK_TIME="$(bitcoin-cli getblock $PREVIOUS_BLOCK_HASH | jq '.mediantime')"
DELTA_TIME="$(($CURRENT_BLOCK_TIME-$PREVIOUS_BLOCK_TIME))"
const Corestore = require('corestore')
const SwarmNetworker = require('corestore-swarm-networking')
const store = new Corestore('./path-1')
store.ready(function () {
const swarm = new SwarmNetworker(store)
const feed = store.default()
swarm.listen()

Hyperswarm DHT setup

Checking your network for P2Pness

Running a node

Running a dht node is as simple as installing the DHT cli.

npm i -g @hyperswarm/cli