First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
| $my-icons-spacing: 10px; // give some space to avoid little pixel size issues on resize | |
| @import "my-icons/*.png"; | |
| $my-icons-sprite-dimensions: true; | |
| @include all-my-icons-sprites; | |
| // the fun part |
| <?php | |
| /** | |
| * ProcessWire 'Image Fit Boundaries' module | |
| * | |
| * Module to calculate the max size a image can take in a boundary box. | |
| * © Martijn Geerts 2013 | |
| * | |
| * Usage: | |
| * |
| RewriteEngine On | |
| # Allows our static assets to be versioned | |
| # javascript (js) is versioned seperately because it has a more complicated build process | |
| # also create a shortcut path /a/ for static assets because it uses less characters | |
| RewriteRule ^js-built/([0-9]+)/(.*)$ /js-built/$2 [L] | |
| RewriteRule ^a/([0-9]+)/(.*)$ /assets/$2 [L] | |
| RewriteRule ^assets/([0-9]+)/(.*)$ /assets/$2 [L] |
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var del = require('del'); | |
| var uglify = require('gulp-uglify'); | |
| var gulpif = require('gulp-if'); | |
| var exec = require('child_process').exec; | |
| var notify = require('gulp-notify'); |
| // Brightness math based on: | |
| // http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx | |
| $red-magic-number: 241; | |
| $green-magic-number: 691; | |
| $blue-magic-number: 68; | |
| $brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number; | |
| @function brightness($color) { | |
| // Extract color components |
| module Sass::Script::Functions | |
| def file_exists(path) | |
| return bool(false) unless options[:filename] # not all sass has a file name (e.g. std input) | |
| current_directory = File.dirname(options[:filename]) rescue nil # a sass filename from an importer may not be processable by File.dirname | |
| return bool(false) unless current_directory && File.exist?(current_directory) # not all sass files are served from the filesystem | |
| full_path = File.expand_path(path.value, current_directory) # a relative path will be expanded against the current_directory of the sass file, symlinks will be followed, absolute paths will be left alone. | |
| return bool(File.exist?(full_path)) | |
| end | |
| end |
| <html> | |
| <head> | |
| <title>Select styles with CSS only</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> | |
| /* Some basic page styles */ | |
| body { | |
| background-color: #fff; | |
| font-family: helvetica, sans-serif; |
NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.
I'd like to hear how you approach this: @valuedstandards or comment on this gist.
You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':
| var gulp = require('gulp'), | |
| q = require('q'), | |
| path = require('path'), | |
| fs = require('fs'), | |
| Grunticon = require('grunticon-lib'); | |
| gulp.task('icons', function () { | |
| var deferred = q.defer(), | |
| iconDir = 'app/images/icons/', | |
| options = { enhanceSVG: true }; |