Skip to content

Instantly share code, notes, and snippets.

@deanmlittle
deanmlittle / mapi.md
Last active May 9, 2022 22:42
Why mAPI is shit

A far from exhaustive list of reasons why mAPI is shit

  1. While it's an acceptable bandaid for now, we probably shouldn't just wrap JSON-RPC. It's really slow, and there's no reason to run an HTTP server that accesses another HTTP server. It's pretty silly tbh.
  2. Nobody likes C#. Like, nobody.
  3. You shouldn't have to go and install an entire postgres database in parallel to a mining node (both of which just love to compete with eachother to consume maximum resources) just to offer people different fee rates. If you had to do something like this, SQLite would be a much more lightweight alternative, however in almost all cases, miners will probably want to just run their own mining consoles (like any other kind of API service provider would) where they manage all this stuff themselves, so in reality, a simple JWT with an exp field, a fee field and a signing secret without any kind of user management whatsoever is probably already sufficient. If you have strong opinions to the contrary about thi
@kevinejohn
kevinejohn / Etched TX Format
Last active June 2, 2020 23:39
https://etched.page bitcoin transaction file format
https://whatsonchain.com/tx/05757b42770da5ee5835a9156f4e5ed9466b5d320117e222cde9a8661bfc56a8
@andrewosh
andrewosh / README.md
Created May 11, 2020 02:44
A smal,l end-to-end example of using Hyperdrive/Hyperswarm to replicate a drive

Note: To keep this even smaller, we're using a small helper module called the hyperswarm replicator, which wraps a few Hyperswarm setup details.

@ordishs
ordishs / verify.js
Last active March 15, 2024 00:30
Small example of the steps needed to verify the merkle proofs of a transaction provided by WhatsOnChain.
const crypto = require('crypto')
const assert = require('assert')
function sha256 (buffer) {
assert(Buffer.isBuffer(buffer), `Argument must be a buffer, received ${typeof buffer}`)
const hash = crypto.createHash('sha256')
hash.update(buffer)
return hash.digest()
}
@Arinerron
Arinerron / permissions.txt
Last active June 14, 2024 14:21
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
#!/usr/bin/env python3
'''
Angellist Web Search Scraper
Author: Kyle Manna
The goal of htis tool is to scrape the Angellist search results becaues the
Search API [1] only returns 20 results with no pagination at the time of
this writing (2015.09.06).
@kevinejohn
kevinejohn / sync_unit_files.sh
Last active September 3, 2015 09:19
Copy unit files to remote VPS
#!/bin/bash
WEB_IP=$1
rsync --archive --progress --compress ./*.service core@$WEB_IP:/home/core/
ssh core@$WEB_IP sudo cp /home/core/*.service /etc/systemd/system/
ssh core@$WEB_IP sudo systemctl daemon-reload
@kevinejohn
kevinejohn / gist:684942f7e3e40fbe869e
Created July 24, 2015 23:51
Allocating Swap CoreOS
sudo fallocate -l 1G /swap
sudo mkswap /swap
sudo chmod 600 /swap
sudo swapon /swap
@jareware
jareware / s3-curl-backups.md
Last active May 11, 2024 23:39
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@nicolashery
nicolashery / gulpfile-react-jshint.js
Created October 20, 2014 17:06
Gulpfile for JSHint on a React app with watch, JSX error logging, and cache
var gulp = require('gulp');
var react = require('gulp-react');
var jshint = require('gulp-jshint');
var cache = require('gulp-cached');
var jsFiles = [
'src/**/*.js',
'test/**/*.js',
'*.js'
];