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
@maettig
maettig / LICENSE.txt
Created November 21, 2011 23:12 — forked from 140bytes/LICENSE.txt
Pac-Man in 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Thiemo Mättig <http://maettig.com/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@njh
njh / _README.md
Last active October 5, 2019 12:06
Shell script to create a WebID certificate using OpenSSL
@wch
wch / vega-legend-update.html
Last active November 2, 2017 05:27
Example of vega data and legend updates
<!DOCTYPE html>
<html>
<head>
<script src="http://trifacta.github.io/vega/lib/d3.v3.min.js"></script>
<script src="http://trifacta.github.io/vega/vega.js"></script>
</head>
<body>
<script type="text/javascript">
var iris_spec = {
@deiu
deiu / linkheaderparser.js
Last active July 25, 2019 11:34
Parse HTTP Link header in Javascript
// parse a Link header
//
// Link:<https://example.org/.meta>; rel=meta
//
// var r = parseLinkHeader(xhr.getResponseHeader('Link');
// r['meta'] outputs https://example.org/.meta
//
function parseLinkHeader(header) {
var linkexp = /<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g;
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g;
@piatra
piatra / peerjsdemo.html
Created April 12, 2014 09:08
peer js demo
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<button>connect</button>
<script src="http://cdn.peerjs.com/0.3/peer.js"></script>
@afk11
afk11 / gist:a9d5198c205879c25c01
Created July 5, 2014 12:32
Bitcore BIP32 key deriv + raw transaction signing (not working at present)
<!DOCTYPE html>
<html>
<head>
<title>User Registration</title>
<script src="bitcorelatest.js"></script>
<script>
// Derive given private key index..
function get_bip32_key(path) {
@nickretallack
nickretallack / test_spkac.sh
Last active January 23, 2018 05:28
This should work, right?
openssl genrsa -out private.pem 4096
openssl spkac -key private.pem > public.spkac
echo "CN=test" >> public.spkac
openssl ca -config openssl.conf -extensions client -spkac public.spkac -out signed.pem -batch
openssl pkcs12 -nodes -export -inkey private.pem -in signed.pem -out cert.p12
# No certificate matches private key
@melvincarvalho
melvincarvalho / post to ldpc and acl
Created February 1, 2015 10:18
post to ldpc and acl
# init
#LDPC="https://localhost:8888/test/put/"
#LDPC="https://melvin.rww.io/workspace/blog/ch5/"
LDPC=$(git config webid.weblog)
KEYFILE=$(git config webid.keyfile)
WEBID=$(git config user.webid)
NAME=$(git config user.name)
DEPICTION=$(git config user.depiction)
USER_AGENT='User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/39.0.2171.65 Chrome/39.0.2171.65 Safari/537.36'
@melvincarvalho
melvincarvalho / log.js
Last active August 29, 2015 14:14
log gitter to file and ldp
var https = require('https');
var fs = require('fs');
var roomId = process.env.ROOM_ID;
var token = process.env.TOKEN;
var heartbeat = " \n";
console.log('logging room : ' + roomId);
var gitter = {
@melvincarvalho
melvincarvalho / publickey.js
Last active August 29, 2015 14:26
convert openssh id_rsa.pub to modulus and exponent
#!/usr/bin/env node
// requires
var forge = require('node-forge');
var fs = require("fs");
// init
var sshpubkey = {};
var pubkey;