(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| var svg = document.querySelector( "svg" ); | |
| var svgData = new XMLSerializer().serializeToString( svg ); | |
| var canvas = document.createElement( "canvas" ); | |
| var ctx = canvas.getContext( "2d" ); | |
| var img = document.createElement( "img" ); | |
| img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) ); | |
| img.onload = function() { |
| ## Auto-restart PHP when it's returning errors | |
| # | |
| # Make sure that http://localhost/test.php is an actual PHP script. If it starts returning | |
| # 500 errors, restart the PHP-FPM service | |
| * * * * * /usr/bin/curl --head -sf http://localhost/test.php -o /dev/null || /usr/sbin/service php5-fpm restart |