- IE11 will ignore the border-box box model when calculating the flex-basis width. EG: https://gist.github.com/badsyntax/61b28a0c9f804c483e8a
- IE11 will not apply flexbox on pseudo-elements. EG: http://jsbin.com/zawaju/1 (Reported here: https://connect.microsoft.com/IE/feedbackdetail/view/1058330/ie11-will-not-apply-flexbox-on-pseudo-elements)
- IE11 has issues with flex-grow, justify-content: space-around and max-width https://connect.microsoft.com/IE/feedbackdetail/view/951267/horizontal-scrolling-with-flex-grow-max-width
- IE11 flex-grow will not work with containers with min-height set: https://connect.microsoft.com/IE/feedback/details/816293/ie11-flexbox-with-min-height-not-vertically-aligning-with-align-items-center and here:https://connect.microsoft.com/IE/feedback/details/802625/min-height-and-flexbox-flex-direction-column-dont-work-together-in-ie-10-11-preview
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
b=0;$=x=>(p,i="_"+b++,u=($[i]=q=>eval(i).innerHTML=x(p,$[q],u),z=>($[++b]=z,`$.${i}(${b})`)))=>`<c id=${i}>${x(p,[]._,u)}</c>` |
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
# On Debian, you need to install these packages: | |
# jpegoptim optipng pngcrush advancecomp | |
import subprocess | |
from os.path import splitext | |
from django.dispatch import receiver | |
from easy_thumbnails.signals import saved_file, thumbnail_created | |
# on-save image optimization |
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
// Lazy (=on-demand) zip() | |
for (const [i, x] of zip(naturalNumbers(), naturalNumbers())) { | |
console.log(i, x); | |
if (i >= 2) break; | |
} | |
// Output: | |
// 0 0 | |
// 1 1 | |
// 2 2 |
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
/* | |
Show a progress element for any form submission via POST. | |
Prevent the form element from being submitted twice. | |
*/ | |
(function (win, doc) { | |
'use strict'; | |
if (!doc.querySelectorAll || !win.addEventListener) { | |
// doesn't cut the mustard. | |
return; | |
} |
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
#!/bin/bash | |
# Start this scipt above the /piwik directory. | |
# We assume that the webserver runs under www-data. | |
# download & verify | |
wget -nv "http://builds.piwik.org/piwik.zip" || exit 1 | |
wget -nv "http://builds.piwik.org/piwik.zip.asc" || exit 2 | |
gpg --verify piwik.zip.asc || exit 3 |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.
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
/*! | |
* $.preload() function for jQuery – http://mths.be/preload | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
*/ | |
jQuery.preload = function(array) { | |
var length = array.length, |
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
(function () { | |
var previousInputMode = false; | |
var inputMode = (function() { | |
try { | |
var inputMode = window.sessionStorage.getItem('inputMode'); | |
if (!inputMode) { | |
return undefined; | |
} | |
if (window.ga) { | |
window.ga('set', 'dimension1', inputMode); |
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
<?php | |
/** | |
How to run a code coverage report on a web page: | |
Simply put this code after the vendor require and before the rest of the calling logic. | |
(Assumes you have PHPUnit installed) | |
**/ | |
require_once __DIR__ . "/../vendor/autoload.php"; |