Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Bumann bumi

View GitHub Profile
View lnd.php
<?php
// Path to autoload.php created by composer.
require dirname(__FILE__).'/../vendor/autoload.php';
error_reporting(2);
$lndIp = ''; // IP:PORT
$sslCert = '';
View gemfile-parser.rb
require 'bundler'
gemfile = Bundler::Dsl.new
gemfile.eval_gemfile(ENV['BUNDLE_GEMFILE'] || 'Gemfile')
dependencies = gemfile.dependencies
# specs = dependencies.map(&:to_spec)
dependencies.each do |d|
begin
spec = d.to_spec
@bumi
bumi / PKGBUILD
Last active May 19, 2020
PKGBUILD for screen.so
View PKGBUILD
# Maintainer: Michael Bumann <hello@michaelbumann.com>
pkgname=screen-desktop
pkgver=1.2.0
pkgrel=1
pkgdesc="Desktop client for screen.so"
arch=('x86_64')
url="https://screen.so"
license=('unknown')
depends=()
makedepends=('libarchive')
@bumi
bumi / yjs-pg-server.js
Created Mar 20, 2020
implementation of a websocket server storing yjs documents in a postgresql database
View yjs-pg-server.js
const WebSocket = require('ws');
const http = require('http');
const Y = require('yjs');
const wsUtils = require('./utils');
const cookie = require('cookie');
const QuillDelta = require('quill-delta');
//const QuillConverter = require('node-quill-converter');
//const MdastFromQuillDelta = require('mdast-util-from-quill-delta');
View gist:1b6de0f8b2b47a458f7a779264268521
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ipfs.kosmos.org:5444/api/v0/id?stream-channels=true. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
=> https://github.com/INFURA/tutorials/wiki/IPFS-and-CORS#configuration-of-cors
=> https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default
View acl-debug.sol
pragma solidity ^0.5.6;
contract Auth {
enum Op { NONE, EQ, NEQ, GT, LT, GTE, LTE, RET, NOT, AND, OR, XOR, IF_ELSE }
bytes32 paramHash;
mapping (bytes32 => bytes32) public permissions; // permissions hash => params hash
mapping (bytes32 => Param[]) public permissionParams; // params hash => params
@bumi
bumi / satellite.rb
Created Feb 9, 2019
quck example to use the blockstream_satellite ruby gem
View satellite.rb
require "blockstream_satellite"
order = BlockstreamSatellite::Order.create(path: '/path/to/file')
puts order.status #=> pending
order.pay # sends the lightning payment using the configured lnd client
puts order.status #=> transmitting
order.refresh
puts order.status #=> sent
View client.rb
# initialize a client
client = Faraday.new(url: 'https://lightning-2pdf.herokuapp.com/') do |faraday|
faraday.use FaradayLnPaywall::Middleware, { max_amount: 100 }
faraday.adapter Faraday.default_adapter
end
# use the client to do API calls:
puts client.post("/convert/pdf", "# Hallo Welt").body
View lnd.conf
[Application Options]
lnddir=/home/bitcoin/lnd_data
maxpendingchannels=10
alias=YOURALIAS
rpclisten=0.0.0.0:10009
[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind
You can’t perform that action at this time.