Skip to content

Instantly share code, notes, and snippets.

View melvincarvalho's full-sized avatar
💭
I may be slow to respond.

Melvin Carvalho melvincarvalho

💭
I may be slow to respond.
View GitHub Profile
@Anderson-Juhasc
Anderson-Juhasc / bip84.js
Last active January 2, 2020 18:09
BIP84 - Derives segwit + bech32 addresses from zpub and vpub in javascript: https://www.npmjs.com/package/bip84
const bjs = require('bitcoinjs-lib')
, b58 = require('bs58check')
function BIP84(pub) {
// mainnet
this.pub_types = [
'04b24746', // zpub
'02aa7ed3', // Zpub
]
@melvincarvalho
melvincarvalho / fixsolidterms.sh
Last active December 3, 2018 12:56
Fix https in solid terms
#!/usr/bin/env bash
# for i in `find $(pwd) -name publicTypeIndex.ttl` ; do bin/fixsolidterms.sh "$i" ; done
FILE=$1
TMPFILE=/tmp/solidterms.ttl
sed 's/https:\/\/www.w3.org\/ns\/solid\/terms#/http:\/\/www.w3.org\/ns\/solid\/terms#/g' $FILE > $TMPFILE
touch -r $TMPFILE $FILE
mv $TMPFILE $FILE
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Solid World</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
</head>
@melvincarvalho
melvincarvalho / index.html
Created September 19, 2018 08:57 — forked from bellbind/index.html
[solid][browser] pastebins app from tutorial doc
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<script
src="https://solid.github.io/releases/solid.js/solid-client.min.js"
></script>
<script type="module" src="./main.js"></script>
<style>
li > input:checked ~ .child {display: none;}
@melvincarvalho
melvincarvalho / index.html
Last active September 19, 2018 09:03 — forked from bellbind/index.html
[solid][browser] elementary app with solid-auth-client library
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<script src="https://solid.github.io/solid-auth-client/dist/solid-auth-client.bundle.js"></script>
<script type="module" src="./main.js"></script>
<style>
#login {display: none;}
#webid:empty ~ #login {display: inline;}
#webid:empty ~ #logout {display: none;}
@bellbind
bellbind / index.html
Last active October 17, 2018 22:41
[solid][browser] elementary app with solid-auth-client library
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<script src="https://solid.github.io/solid-auth-client/dist/solid-auth-client.bundle.js"></script>
<script type="module" src="./main.js"></script>
<style>
#login {display: none;}
#webid:empty ~ #login {display: inline;}
#webid:empty ~ #logout {display: none;}
@bellbind
bellbind / index.html
Created September 18, 2018 07:21
[solid][browser] pastebins app from tutorial doc
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<script
src="https://solid.github.io/releases/solid.js/solid-client.min.js"
></script>
<script type="module" src="./main.js"></script>
<style>
li > input:checked ~ .child {display: none;}
@melvincarvalho
melvincarvalho / databox401.md
Last active February 7, 2018 17:29
How to login via 401 on databox.me

How to login via 401 on databox.me

  1. Go to a URI without access

  2. Login with webid and password

@melvincarvalho
melvincarvalho / databox.md
Last active May 2, 2022 18:53
How to get a WebID + TLS account on databox.me
@melvincarvalho
melvincarvalho / sshToX509.js
Created February 6, 2018 22:25
sshToX509.js
var fs = require("fs");
var forge = require('node-forge');
var debug = require('debug')('converter');
var BigInteger = forge.jsbn.BigInteger;
// change as necessary
var countryName = 'UK';
var domain = 'http://databox.me/';
var localityName = 'London';
var organizationName = 'databox.me';