This file contains hidden or 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
loadPolyfills() | |
.then(() => /* Render React application now that your Polyfills are ready */) | |
/** | |
* Do feature detection, to figure out which polyfills needs to be imported. | |
**/ | |
function loadPolyfills() { | |
const polyfills = [] | |
if (!supportsIntersectionObserver()) { |
This file contains hidden or 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 img = new Image() | |
img.src = this.props.src | |
img.onload = this.onLoadImage | |
img.onerror = this.onLoadImageError |
This file contains hidden or 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
if (!this.props.observeOnScroll) { | |
return false | |
} | |
this.observer = new IntersectionObserver(entries => { | |
entries.forEach(entry => { | |
const { isIntersecting, intersectionRatio } = entry | |
if (isIntersecting === true || intersectionRatio > 0) { | |
this.createImage() |
This file contains hidden or 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
let counter = 0; | |
let scriptMap = new Map(); | |
export const ScriptCache = (function(global) { | |
return function ScriptCache (scripts) { | |
const Cache = {}; | |
Cache._onLoad = function(key) { | |
return (cb) => { | |
let stored = scriptMap.get(key); |
This file contains hidden or 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 casp = require('casper').create({ | |
verbose: true, | |
logLevel: 'debug' | |
}); | |
casp.start().then(function() { | |
var finished = false; | |
var cp = require('child_process'); | |
cp.execFile('/usr/bin/php','test.php', {},function(_,stdout,stderr){ | |
console.log(stdout); |
This file contains hidden or 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
Web components are arguably the Way Of The Future, they provide reusability of code and encapsulation of logic with the view. | |
Angular allows us to create native looking web components with directives, but also allows standalone controllers to be made. | |
Doing things this way helps future-proof our app by forcing us to structure our app like we were using native web components already. |
This file contains hidden or 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
Esto es un gist de prueba |