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
RewriteRule /assets_content/(.*)/_thumbs/(.*)\.svg$ /assets_content/$1/$2.svg [NC,L] |
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
Email regex: (supports pluses and dots in username) | |
/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/ | |
URL regex: (validates both with and without http://) | |
/^((http|https):\/\/)?(www[.])?([a-zA-Z0-9]|-)+([.][a-zA-Z0-9(-|\/|=|?)?]+)+$/ |
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
Headers as columns: | |
<table> | |
<tr> | |
<th scope="col">User costs</th> | |
<th scope="col">Business costs</th> | |
</tr> | |
<tr> | |
<td>What about your product might the user ignore if a form is onerous?</td> | |
<td>Where will you keep all of this stuff?</td> | |
</tr> |
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
<style> | |
em.sarcastic { | |
display: inline-block; | |
font-style: normal; | |
-webkit-transform: rotate(-15deg) skew(0, 15deg); | |
-moz-transform: rotate(-15deg) skew(0, 15deg); |
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
<figure data-picture data-alt=""> | |
<div data-src="<!-- URL for standard image here -->"></div> | |
<div data-src="<!-- URL for high-DPI image here -->" data-media="(min-device-pixel-ratio: 2.0)"></div> | |
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. --> | |
<noscript><img src="<!-- URL for standard image here -->" alt=""></noscript> | |
</figure> | |
<figure data-picture data-alt=""> | |
<div data-src="<!-- URL for small-screen image here -->" data-media="(max-width: 700px)"></div> |
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
'svg' => 'image/svg+xml', |
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
0. Make sure local and dev files are in synch. | |
1. turn off comments on prod | |
... by hiding the comment form | |
2. clear caches on prod | |
3. turn off local | |
4. clear caches on local | |
5. make local copy of prod db |
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.onkeydown = checkKey; | |
function checkKey(e) { | |
e = e || window.event; | |
if ((e.keyCode == '39') || (e.keyCode == '40')) { // right / down arrow | |
console.log('right / down'); | |
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
$('img').on('error', function(){ | |
//console.log('img load failure: ' + $(this).attr('src')); | |
var fallback = $(this).attr('data-fallback'); | |
if (typeof fallback !== 'undefined' && fallback !== false) { | |
$(this).attr('src', fallback); | |