Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Trollbäck AntonTrollback

View GitHub Profile
View index.js
const html = require('bel');
const labelTexts = [
"Fin de la|Pobreza",
'Hambre|Cero',
'Salud|y Bienestar',
'Educatión|de Calidad',
'Igualdad|de Género',
'Agua Limpia|y Saneamiento',
'Energía Asequible|y No Contaminante',
@AntonTrollback
AntonTrollback / fix-safari-svg-use.js
Created Sep 7, 2015
Fix Safari issue where svg <use> might not display in unless forced to rerender at page load
View fix-safari-svg-use.js
var els = document.getElementsByTagName('use');
Array.prototype.forEach.call(els, function(el) {
el.setAttribute('xlink:href', el.getAttribute('xlink:href'));
});
@AntonTrollback
AntonTrollback / logga.php
Last active Apr 12, 2016
log php to browser console
View logga.php
function logga() {
echo '<script>console.log(';
foreach (func_get_args() as $index => $arg) {
$type = gettype($arg);
if ($type === 'boolean') {
$arg = $arg ? 'true' : 'false';
} elseif ($type === 'string') {
$arg = '"' . $arg . '"';
@AntonTrollback
AntonTrollback / flex-utils.css
Created Feb 17, 2015
Suitcss Flex utilities
View flex-utils.css
/**
* Note: `min-height` flex container won't apply to its flex items in IE 10-11
* More info: http://git.io/NbmO
* Can be targeted with selector hack: http://git.io/Nbqx
*/
.u-flex {
display: flex;
}
View shine.css
/* Icon */
.icon {
display: block;
width: 32px;
height: 32px;
margin: 50px;
border-radius: 3px;
background: CornflowerBlue;
@AntonTrollback
AntonTrollback / index.css
Last active Mar 7, 2016
Helper for styling tabbed focus states: html.tabbing a:focus { }
View index.css
a {
color: rebeccapurple;
text-decoration: none;
outline: 0;
}
a:hover,
a:active {
color: rebeccapurple;
text-decoration: underline;
View expanding-border.css
/*
* Expanding border
* Inspired by Scorekeeper - youtu.be/sXqXpwyBI1k
*/
.btn {
position: relative;
display: block;
width: 100px;
height: 100px;