Skip to content

Instantly share code, notes, and snippets.

View darobin's full-sized avatar
✍️
writing, writing, writing…

Robin Berjon darobin

✍️
writing, writing, writing…
View GitHub Profile
@darobin
darobin / README.md
Last active August 11, 2016 09:14 — forked from anonymous/README.md
JSON-LD Playground: SBAON
import React from 'react'
import Portal from 'react-portal'
class LinkBlock extends React.Component {
constructor (props) {
super(props)
this.state = {
href: this.props.node.data.get('href'),
showingPopup: false,
popup: null,
@darobin
darobin / composition.html
Last active March 9, 2020 19:22
Having fun with composition events!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CompositionUpdate</title>
</head>
<body>
<input id="input">
<pre id="log"></pre>
<script>
<!--
NOTES:
- this does not include affiliation for people: that is a more complex situation (we might be happy with just the ORCID).
- there is no specific subtyping information, I am unsure what to do there.
- this is deliberately using RDFa.
-->
<div typeof="schema:Dataset" resource="doi:10.4242/cryptoZ.2017">
<span property="schema:name">Sightings of Levrogyrous Dahuts during Transalpine Migratory Periods</span>
<span property="schema:author" typeof="schema:Person" resource="http://orcid.org/0000-0002-1731-5346">
<span property="schema:name">Robin Berjon</span>
// from the brilliant mind of sb
var _catch = Promise.prototype.catch;
Promise.prototype.catch = function () {
return _catch.call(this, function (err) { setTimeout(function () { throw(err); }, 0); });
}
@darobin
darobin / dependency.md
Last active January 28, 2016 21:13
Schema.org dependencies for software and data

In npm you can express the basic informaion about a project and its dependencies in the following manner:

{
  "name": "dahut",
  "version": "1.42.17",
  "dependencies": {
    "cryptozoology": "^0.9.2",
 "jsdom": "1.2.7 || &gt;=1.2.9 &lt;2.0.0",
@darobin
darobin / calorimetre.js
Created December 18, 2015 18:13
a quick and dirty tool to know what is taking up space in a bundle
// a quick and dirty tool to know what is taking up space in a bundle
// this should be made generic
// USAGE:
// - save it somewhere
// - replace `entryFile` with the path to your entry point
// - check that the browserify options make some sort of sense
// - run it
// The output will be a long list of dependencies. The first is the entry point, after that they're ordered
// by size. Each lists its size and what includes it. You can use that to get a feel for what can be usefully
// optimised out.
@darobin
darobin / cookie-doorslam.html
Created August 5, 2015 14:03
Simple idea: a browser extension that automatically kills the parent element of <link rel="cookie-policy">
@darobin
darobin / hsv2rgb.js
Created May 28, 2015 16:05
Convert HSV to RGB
function HSVtoRGB (hsv) {
// this doesn't work for the values of 0 and 360
// here's the hacky fix
var h = hsv[0];
if (h === 0) h = 1;
if (h === 360) h = 359;
// Rebase the h,s,v values
h = h/360;
var s = hsv[1]/100
, v = hsv[2]/100
@darobin
darobin / .travis.yml
Created March 20, 2015 11:33
Automatically publishing on commit
language: node_js
branches:
only:
- gh-pages
env:
global:
- URL="http://w3c.github.io/manifest/ECHIDNA"
- DECISION="https://lists.w3.org/Archives/Public/public-webapps/2014JulSep/0627.html"