Skip to content

Instantly share code, notes, and snippets.

View sebilasse's full-sized avatar

Sebastian Lasse sebilasse

View GitHub Profile
/* TODO - FIXME function was written from scratch, SHOULD be in an "openstreetmap" module !!! */
function parseOSM(query) {
$(":root").addClass('js');
var drawMap = function(id, latLon) {
var mPoint = ol.proj.transform([latLon[1], latLon[0]], 'EPSG:4326', 'EPSG:3857');
var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(mPoint) });
var iconStyle = new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 46],

Proposal : Scoped IndieAuth

draft0 :: extension, completely backwards compatible

Story

As an internet user I would like my personal domain to serve as my online identity and so I am using the best solution, "IndieAuth" :

I have to enter my own domain directly at any page where I want to login , but

@sebilasse
sebilasse / dojo2_request_node.ts
Last active October 9, 2016 17:12
dojo2/request/node changes
/* dojo2/request/node */
/* imports ... TODO MOD:
uses a custom Error for `maxRedirects` :
`import RequestMaxRedirectsError from './errors/RequestMaxRedirectsError';`
and needs `lang/mixin`
*/
// TODO: Where should the dojo version come from? It used to be kernel, but we don't have that.
let version = '2.0.0-pre';
@sebilasse
sebilasse / LDOsnippets.js
Created August 30, 2016 11:27
How to validate a hyperschema LDO ?
/*
Question: GET parameters OR POST body are validated with LDO#schema -
but how to validate (RFC 6570) URI template variables in the path ?
1) Path variables must be unique ("exclusive from params|body").
They could then be mixed in the params|body and validated via LDO#schema as well
2) Heroku seems to make use of parantheses in URI templates to validate the variales
RFC 6570 : "The expression syntax specifically excludes use of the dollar ("$") and parentheses ["(" and ")"] characters
so that they remain available for use outside the scope of this specification." ::
@sebilasse
sebilasse / check.sh
Created August 29, 2016 09:05 — forked from remy/check.sh
Obviously change remysharp.com for the domain you want to check.
curl http://web.archive.org/cdx/search/cdx\?limit\=1\&url\=remysharp.com | awk '{ print $2 }' | xargs date -j -f "%Y%m%d%H%M%S"
@sebilasse
sebilasse / schema-org-gen-test
Created August 6, 2016 11:58
node.js test validation of schema.org JSON Schema, see https://github.com/geraintluff/schema-org-gen/pull/4
var fs = require('fs');
var path = require('path');
var tv4 = require('tv4');
var dir = '/ENTER_THE_PATH_TO__schema.org_DIR__HERE';
var schema = path.join(dir, 'Event.json');
var data = {
"@context": "http://schema.org",
"@type": "Event",
@sebilasse
sebilasse / html5_link_rel.json
Last active February 5, 2016 20:07
<a rel= values JSON