Skip to content

Instantly share code, notes, and snippets.

View papandreou's full-sized avatar
💭
🤗

Andreas Lind papandreou

💭
🤗
View GitHub Profile
@papandreou
papandreou / ttx.diff
Created July 7, 2019 08:54
diff from ttx of roboto-black RO subset created with hbsubset to one created with the wasm build
--- roboto-black-subset-with-hbsubset.ttx 2019-07-07 10:49:56.000000000 +0200
+++ roboto-black-subset-with-wasm.ttx 2019-07-07 10:49:42.000000000 +0200
@@ -1,1359 +1,303 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.43">
<GlyphOrder>
<!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name="O"/>
@papandreou
papandreou / sv.js
Created April 7, 2019 22:49
CldrRbnfRuleSet bug in node-cldr
function renderSpelloutNumbering(n) {
const isFractional = n !== Math.floor(n);
if (n < 0) return 'minus ' + this.renderSpelloutNumbering(-n);
if (isFractional && n > 1)
return (
this.renderSpelloutNumbering(Math.floor(n)) +
' komma ' +
this.renderSpelloutNumbering(parseInt(String(n).replace(/\d*\./, ''), 10))
);
if (n >= 1000000000000000000) return this.renderNumber(n, '#,##0');
@papandreou
papandreou / log.txt
Created January 10, 2019 18:21
Output of stryker on express-extractheaders
[express-extractheaders]$ stryker run
19:20:23 (3766) INFO ConfigReader Using stryker.conf.js in the current working directory.
19:20:23 (3766) INFO MochaOptionsLoader Loading mochaOpts from "/home/andreas/work/express-extractheaders/test/mocha.opts"
19:20:23 (3766) INFO InputFileResolver Found 2 of 38 file(s) to be mutated.
19:20:23 (3766) INFO InitialTestExecutor Starting initial test run. This may take a while.
19:20:25 (3766) INFO InitialTestExecutor Initial test run succeeded. Ran 33 tests in 1 second (net 326 ms, overhead 490 ms).
19:20:25 (3766) INFO Stryker 232 Mutant(s) generated
19:20:25 (3766) INFO SandboxPool Creating 4 test runners (based on CPU count)
Mutation testing [==================================================] 100% (ETC n/a) 232/232 tested (37 survived)
@papandreou
papandreou / dabblet.css
Last active November 3, 2018 12:58
Load the static fonts as a fallback
body {
font-family: 'Venn VF', 'Venn', sans-serif;
}
@supports (font-variation-settings: normal) {
@font-face {
font-family: 'Venn VF';
src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_VF.woff2') format('woff2-variations'), /* for Safari */
url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/814870/Venn_VF.woff2') format('woff2'); /* for all other supporting browsers */
font-display: fallback;
(window.webpackJsonp = window.webpackJsonp || []).push([ [ 3 ], {
139: function(e, n, t) {
"use strict";
t.r(n);
t(146), t(50), t(158);
var i = t(0), r = t.n(i), o = t(4), a = t.n(o), l = t(151), s = t(142), u = function(e) {
return r.a.createElement(s.b, {
gridRow: "2",
as: "article"
}, e.children);
@papandreou
papandreou / characters.js
Created June 19, 2018 19:54
subfont -i ../littleplanet-test/index.html --no-recursive --debug
[ { htmlAsset: '../littleplanet-test/index.html',
fontUsages:
[ { texts:
[ 'SERVICES',
'CONTACT',
'Digital design for global changemakers',
'How Simpla helped push the web forward',
'Rucksack helped developers build better experiences, faster' ],
pageText: ' ,ACDEHINORSTVabcdefghiklmnoprstuvwx',
text: ' ,ACDEHINORSTVabcdefghiklmnoprstuvwx',
@papandreou
papandreou / dabblet.css
Last active May 17, 2018 20:44
For Netta: Background images appearing on hover
/**
* For Netta: Background images appearing on hover
*/
ul {
list-style: none;
padding: 0;
}
li:hover::after {
@papandreou
papandreou / 759.css
Last active December 2, 2017 16:34
Stripped down https://mntr-subset.surge.sh/ with weird, indeterministic font downloading behavior i Firefox
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav,
section, summary {
display: block;
}
audio, canvas, video {
display: inline-block;
}
audio:not([controls]) {
@papandreou
papandreou / run.js
Created October 27, 2017 09:32
Helper for running a shell command and buffering up its output
const childProcess = require('child_process');
function consumeStream(stream) {
return new Promise((resolve, reject) => {
const buffers = [];
stream
.on('data', buffer => buffers.push(buffer))
.on('end', () => resolve(Buffer.concat(buffers)))
.on('error', reject);
});
@papandreou
papandreou / httpservertesttemplate.js
Created July 28, 2017 14:49
Spin up a test server on a random port
describe('my server', function () {
let serverUrl;
beforeEach(function () => {
const server = http.createServer((req, res) => {
// ...
}).listen(0);
const serverAddress = server.address();
const serverHostname = serverAddress.address === '::' ? 'localhost' : serverAddress.address;
serverUrl = 'http://' + serverHostname + ':' + serverAddress.port + '/';