Skip to content

Instantly share code, notes, and snippets.

View deiu's full-sized avatar

Andrei deiu

View GitHub Profile
@deiu
deiu / queryVals.js
Created June 14, 2016 18:58
Parse a URL to map query parameters to their values
// Map URL query items to their values
// e.g. ?referrer=https... -> queryVals[referrer] returns 'https...'
var queryVals = (function (a) {
if (a === '') return {}
var b = {}
for (var i = 0; i < a.length; ++i) {
var p = a[i].split('=', 2)
if (p.length === 1) {
b[p[0]] = ''
} else {
@deiu
deiu / deploy.sh
Last active December 25, 2015 00:58
RWW.IO Web app deployer
#!/bin/sh
# RWW.IO Web app deployer. Simply run `sh deploy.sh` inside your Web app dir and follow the steps.
CERTCMD=""
# get target URI
read -p "Please provide the URI of the target dir (ex: http://example.org/apps/myapp/): " HOST
if [ "$HOST" = "" ]
then
@deiu
deiu / delegated-webid.py
Created July 6, 2012 11:03
Uses a certificate (in PEM) to authenticate (through WebID) and access a protected page.
#!/usr/bin/env python
import urllib
import httplib2
cert_file = 'my.pem'
http = httplib2.Http(disable_ssl_certificate_validation=True)
http.add_certificate('', cert_file, domain='')
Verifying that +deiu is my openname (Bitcoin username). https://onename.com/deiu