Skip to content

Instantly share code, notes, and snippets.

View Sjors's full-sized avatar

Sjors Provoost Sjors

View GitHub Profile
@jpmckinney
jpmckinney / keychain.rb
Created November 9, 2010 02:56
Access the OS X Keychain from Ruby
# blog post: http://blog.slashpoundbang.com/post/1521530410/accessing-the-os-x-keychain-from-ruby
class KeyChain
def self.method_missing(meth, *args)
run args.unshift(meth)
end
def self.find_internet_password(*args)
# -g: Display the password for the item found
output = quiet args.unshift('find-internet-password', '-g')
@mutatrum
mutatrum / taproot.sh
Last active June 12, 2021 16:44
Print a taproot signalling block diagram
#!/bin/bash
BLOCKCHAININFO=$(bitcoin-cli getblockchaininfo)
BLOCKS=$(echo "$BLOCKCHAININFO" | jq .blocks)
TAPROOT=$(echo "$BLOCKCHAININFO" | jq .softforks.taproot.bip9)
SINCE=$(echo "$TAPROOT" | jq .since)
PERIOD=$(echo "$TAPROOT" | jq .statistics.period)
BLOCKS=$(echo "$BLOCKCHAININFO" | jq .blocks)
PERIOD_COUNT=$(((BLOCKS - SINCE) / PERIOD))
SINCE=$((SINCE + (PERIOD * PERIOD_COUNT)))
ELAPSED=$(echo "$TAPROOT" | jq .statistics.elapsed)
@aureleoules
aureleoules / unwrap-pr.js
Created September 15, 2022 08:24
Load all PR comments
javascript: (async function() {
async function unwrap() {
const loadMoreBtn = document.querySelector('button.ajax-pagination-btn.no-underline.pb-1.pt-0.px-4.mt-0.mb-1.color-bg-default.border-0');
if (loadMoreBtn) {
loadMoreBtn.click();
await setTimeout(unwrap, 5000);
}
}
await unwrap();
await setTimeout(() => document.querySelectorAll('span.Details-content--closed').forEach((e) => {