This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This transform works on an assumption about browser loading and rendering behavior of CSS: | |
* When a browser loads CSS in <head> it render blocks untill all CSS in <head> has loaded. | |
* | |
* That might be slow. | |
* | |
* To appear faster, browsers will render what they have in buffer already if they meet a style <link> in <body> | |
* before they dive into the render blocking load. | |
* This lets you potentially inline critical css in <head> and put the bulk of your CSS "below the fold". | |
* The effect will be a quick render with critical styles applied, just before the render blockign starts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { totalCols } = config | |
function crazyCaterpillar(time) { | |
const newLights = new Lights() | |
let dead = []; | |
for (let i = 0; i < 3; i++) { | |
dead.push(Math.round(Math.random() * totalCols)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
fs.open('hello-world.txt', 'ax', function (err, fd) { | |
if (err) { | |
console.error(err); | |
} | |
fs.write(fd, new Buffer('hello world'), function (err) { | |
if (err) { | |
console.log('manual', 'noooo'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
h1 { padding: 50px 200px; border: 3px dotted gray; } | |
h1.drag { background: #123456; cursor: grabbing;} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jspm = require('../package.json').jspm; | |
var jsdom = require('jsdom'); | |
var async = require('async'); | |
var chalk = require('chalk'); | |
var express = require('express'); | |
var app = express(); | |
app | |
.get('*.html', function (req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
var expect = require('unexpected'); | |
var React = require('react'); | |
var ReactTestUtils = React.addons.TestUtils; | |
var RadioGroup = require('jsx!../RadioGroupComponent.jsx'); | |
describe('RadioGroupComponent', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.addEventListener('focus', function (el) { | |
if (el.tagName === 'A' && (el.getAttribute('href') || '').indexOf('mailto:') === 0) { | |
el.setAttribute('target', '_blank'); | |
} | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TAP version 13 | |
# Crawling internal assets | |
ok 1 loading https://mntr.dk/ | |
ok 2 loading https://mntr.dk/favicon.ico | |
ok 3 loading https://mntr.dk/assets/images/favicon/152.png | |
ok 4 loading https://mntr.dk/assets/images/favicon/144.png | |
ok 5 loading https://mntr.dk/assets/images/favicon/120.png | |
ok 6 loading https://mntr.dk/assets/images/favicon/114.png | |
ok 7 loading https://mntr.dk/assets/images/favicon/72.png | |
ok 8 loading https://mntr.dk/assets/images/favicon/57.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Different size images based on same source image */ | |
.thing-4x { background-size: 100px; background-image: url(image.svg?inkscape&resize=400); } | |
.thing-2x { background-size: 100px; background-image: url(image.svg?inkscape&resize=200); } | |
.thing-1x { background-size: 100px; background-image: url(image.svg?inkscape&resize=100); } | |
/* Different size images based on same source image, in individual sprite sheets */ | |
.thing-4x { background-size: 100px; background-image: url(image.svg?inkscape&resize=400&sprite=4x); } | |
.thing-2x { background-size: 100px; background-image: url(image.svg?inkscape&resize=200&sprite=2x); } | |
.thing-1x { background-size: 100px; background-image: url(image.svg?inkscape&resize=100&sprite=1x); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.frame-1 { background-image: url(frames/1.png?sprite); } | |
.frame-2 { background-image: url(frames/2.png?sprite); } | |
.frame-3 { background-image: url(frames/3.png?sprite); } | |
.frame-4 { background-image: url(frames/4.png?sprite); } | |
.frame-5 { background-image: url(frames/5.png?sprite); } | |
.frame-6 { background-image: url(frames/6.png?sprite); } | |
.frame-7 { background-image: url(frames/7.png?sprite); } | |
.frame-8 { background-image: url(frames/8.png?sprite); } | |
.frame-9 { background-image: url(frames/9.png?sprite); } |