Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
<?php | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
$media-queries: true; | |
@mixin bp($point) { | |
@if ($media-queries) { | |
$bp-large-screen: 1824px; | |
$bp-bigscreen: 1824px; | |
$bp-ipad-max: 1024px; | |
$bp-ipad-min: 768px; | |
$bp-iphone5-max: 568px; | |
$bp-iphone-max: 480px; |
<?php | |
$query1 = new WP_Query($arg1); | |
$query2 = new WP_Query($arg2); | |
$query = new WP_Query(); | |
$query->posts = array_merge( $query1->posts, $query2->posts ); | |
// we also need to set post count correctly so as to enable the looping |
# Enable and Disable Browser Caching with .htaccess | |
## Enable Examples | |
### 1 MONTH for static assets | |
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
### 1 DAY for rss feeds and robots |
javascript:!function() { var slice = Array.prototype.slice; function throttle(type, name, obj) { obj = obj || window; var running = false; var func = function() { if (running) { return; } running = true; requestAnimationFrame(function() { obj.dispatchEvent(new CustomEvent(name)); running = false; }); }; obj.addEventListener(type, func); } slice .call(document.querySelectorAll("*")) .filter( e => e.scrollWidth > e.offsetWidth || e.scrollHeight > e.offsetHeight ) .filter(e => { var style = window.getComputedStyle(e); return [style.overflow, style.overflowX, style.overflowY].some( e => e === "auto" || e === "scroll" ); }) .forEach(e => { var color = Math.floor(Math.random() * 16777215).toString(16); e.style.backgroundColor = "#" + color; throttle("scroll", "optimizedScroll", e); e.addEventListener("scroll", event => { console.log("%c[scroll]", "color: white; background-color:#" + color, event.target); }); }); }() |
// usage: {{ file.size | prettyBytes }} | |
Vue.filter('prettyBytes', function (num) { | |
// jacked from: https://github.com/sindresorhus/pretty-bytes | |
if (typeof num !== 'number' || isNaN(num)) { | |
throw new TypeError('Expected a number'); | |
} | |
var exponent; | |
var unit; | |
var neg = num < 0; |