Skip to content

Instantly share code, notes, and snippets.

View popeindustries's full-sized avatar
💥

Alexander Pope popeindustries

💥
View GitHub Profile
@popeindustries
popeindustries / bench.js
Created March 17, 2020 18:53
lit-html-server benchmark
'use strict';
const { html, renderToString } = require('@popeindustries/lit-html-server');
const iteration = 10000;
const greeting = 'Hello';
const name = 'special characters, <, >, &';
const drinks = [
{ name: 'Cafe Latte', price: 3.0, sold: false },
{ name: 'Cappucino', price: 2.9, sold: true },
@popeindustries
popeindustries / index.html
Last active October 10, 2019 11:07
<nrk-media-player>
<!-- default UI -->
<nrk-media-player
poster="/somePosterFile.jpg"
src="/someVideoFile.mp4"
controls>
<div fallback>No video for you!</div>
</nrk-media-player>
<!-- default UI and multiple sources -->
<nrk-media-player
@popeindustries
popeindustries / docker.md
Last active August 29, 2015 14:07
Docker notes

http://blog.newrelic.com/2014/08/12/docker-centurion/ https://github.com/newrelic/centurion

We decided to assign ports statically to each application, using a port registry. This let us pre-configure load balancers for an application across a pool of servers and let health checks determine where it is being served. It also let us easily preconfigure our monitoring applications.

Build jobs ship things to a Docker registry, and deployments pull images from a registry and execute them onto servers.

https://nodesource.com/blog/nodesource-docker-images

@popeindustries
popeindustries / keybase.md
Created September 30, 2014 06:39
keybase.md

Keybase proof

I hereby claim:

  • I am popeindustries on github.
  • I am popeindustries (https://keybase.io/popeindustries) on keybase.
  • I have a public key whose fingerprint is 2B2C 04F5 818C 8945 5602 FB56 AA8A E9F1 3E77 D769

To claim this, I am signing this object:

@popeindustries
popeindustries / promise-seq
Created April 9, 2014 07:20
Promise sequence
// Execute tasks in sequence
return tasks.reduce(function (sequence, task) {
return sequence.then(function () {
return task();
});
}, Promise.resolve());
@popeindustries
popeindustries / gist:6422241
Created September 3, 2013 10:34
Work around for getComputedStyle() of pseudo elements in IE 9+
// All browsers
window.getComputedStyle(element, ':before').getPropertyCSSValue('content').cssText;
// IE9+
window.getComputedStyle(element, ':before').content;
@popeindustries
popeindustries / block-text
Created December 5, 2012 10:07
CS: block-text
blockText = el.find('.block-text')
blockText = [blockText] unless _.isArray(blockText)
padding = parseFloat(el.getStyle('padding-left'))/100
width = el.width() * (1 - (padding * 2))
_.forEach blockText, (block) ->
w = block.width()
h = block.height()
ratio = w / h
block.setStyle('font-size', width/ratio) if !isNaN(ratio)
@popeindustries
popeindustries / gist:3819506
Created October 2, 2012 14:21
CS: enable :active on iPhone
# Enable :active styles on touch devices
if /iphone/i.test(navigator.userAgent)
document.addEventListener('touchstart', (->))