Skip to content

Instantly share code, notes, and snippets.

@graham73may
graham73may / rewrite-permalinks.php
Last active August 28, 2019 09:14
Rewrite a single's permalink
dir * -include "._*",".DS*" -Recurse -Force | Remove-Item
# Block Access to microsite before set date
RewriteCond %{TIME} <20180818230000
RewriteRule ^folder-url-here(/)?$ http://www.homepage-url.com [R=307,L]
@graham73may
graham73may / ratio
Created June 13, 2018 09:17
e.g. to achieve responsive 16:9 images
&__image {
background-color : red;
position : relative;
overflow : hidden;
width : 100%;
// Top Image (custom ratio image - closer to 4:3 than 16:9)
&:before {
display : block;
content : "";
@graham73may
graham73may / human_filesize
Created June 1, 2018 12:17
On site and external file size checker
function get_file_size($url, $internal = true)
{
if ($internal) {
$path = parse_url($url, PHP_URL_PATH);
$server_path = $_SERVER['DOCUMENT_ROOT'] . $path;
if (file_exists($server_path)) {
return size_format(filesize($server_path));
}
@graham73may
graham73may / css_resources.md
Created May 17, 2014 16:41 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@graham73may
graham73may / 0_reuse_code.js
Created May 17, 2014 16:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console