Skip to content

Instantly share code, notes, and snippets.

View oscarotero's full-sized avatar
Beautiful, open and accessible web

Óscar Otero oscarotero

Beautiful, open and accessible web
View GitHub Profile

Proposal for a PSR for message translator

The main aim of this proposal is to provide a common interface for the interoperability of message translations across different packages

What is the scope?

  • Provide a way to consume message translations in different languages.
  • Allow handling plurals
  • Allow using translations from different contexts and domains
/**
* iPhone X notch: Remove the white bars in Safari
* It's needed to include the "viewport-fit=cover" directive in the html. For example:
* <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
*
* More info: http://stephenradford.me/removing-the-white-bars-in-safari-on-iphone-x/
*/
.wrapper {
background-color: red;
padding: env(safe-area-inset-top)
<!DOCTYPE html>
<html lang="gl">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Calculadora para facer pan</title>
<style type="text/css">
body {
font-family: sans-serif;
Plato Guille Oscar
Oreja ⭐⭐⭐
Ralla ⭐⭐⭐ ⭐⭐⭐
Fabada con almejas ⭐⭐⭐
Cocido ⭐⭐⭐ ⭐⭐⭐
Albóndigas ⭐⭐⭐
Jurel al ajillo
Espaguetis carbornara ⭐⭐⭐
Arroz marinera ⭐⭐
const contrast = require('wcag-contrast');
const parse = require('csv-parse');
const fs = require('fs');
let counter = 0;
parse(fs.readFileSync('colors.csv'), {from: 2}, (err, result) => {
for (let row of result) {
let [slug, background, foreground] = row;
background = val(background, '#FFFFFF');
@oscarotero
oscarotero / index.html
Created August 4, 2018 18:28
Local storage notes
<!DOCTYPE html>
<html manifest="offline.manifest">
<head>
<meta charset="UTF-8">
<title>Notes - Save notes in your browser</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<meta name="author" content="Oscar Otero - http://oscarotero.com">
<!DOCTYPE html>
<html>
<head>
<title>Drag test</title>
<style>
#zone {
position: relative;
background: yellow;
height: 800px;
}
const version = 'v1';
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(version).then(function(cache) {
return cache.addAll(['/sin-conexion']);
})
);
});
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;