Skip to content

Instantly share code, notes, and snippets.

Melvin Carvalho melvincarvalho

Block or report user

Report or block melvincarvalho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View webtorrent.html
<script src="https://cdn.jsdelivr.net/npm/webtorrent-element@latest/dist/webtorrent-element.min.js"></script>
<web-torrent
src="magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent"
file="Sintel.mp4" />
View update-hook.js
const [seconds, setSeconds] = React.useState(0)
React.useEffect(() => {
const interval = setInterval(() => {
setSeconds(seconds => seconds + 1)
}, 3000)
return () => clearInterval(interval)
}, [])
View 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
View 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')
@melvincarvalho
melvincarvalho / fixsolidterms.sh
Last active Dec 3, 2018
Fix https in solid terms
View fixsolidterms.sh
#!/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
View index.html
<!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 Sep 19, 2018 — forked from bellbind/index.html
[solid][browser] pastebins app from tutorial doc
View index.html
<!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 Sep 19, 2018 — forked from bellbind/index.html
[solid][browser] elementary app with solid-auth-client library
View index.html
<!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;}
@melvincarvalho
melvincarvalho / databox401.md
Last active Feb 7, 2018
How to login via 401 on databox.me
View databox401.md

How to login via 401 on databox.me

  1. Go to a URI without access

  2. Login with webid and password

You can’t perform that action at this time.