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
@melvincarvalho
melvincarvalho / add bookmark
Created July 30, 2019 12:18
add bookmark
const user = 'https://melvincarvalho.com/#me';
const time = new Date().toISOString();
const title = document.title;
const recalls = location.href;
const ms = Math.floor(Math.random() * 1000);
const uri = time.substring(0,4) + time.substring(5,7) + time.substring(8,10) + time.substring(11,13) + time.substring(14,16) + time.substring (17,19) + "." + ms;
console.log(`
<> <http://purl.org/dc/terms/references> <#${uri}> .\n
\n
<#${uri}>\n
@melvincarvalho
melvincarvalho / solid-live-server.js
Created July 25, 2019 13:08
solid-live-server.js
#!/usr/bin/env node
const WebSocket = require('ws')
const WebSocketServer = require('ws').Server
const fs = require('fs')
const uuid = require('uuid')
const handler = require('serve-handler');
const https = require('https');
const INotifyWait = require('inotifywait')
const parallel = require('run-parallel')
@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