- Download https://gist.github.com/jsocol/1089733 and unpack
- Rename
data-uri.py
todata-uri
and copy to/usr/local/bin/
- Open Terminal,
cd /usr/local/bin/
and and thenchmod +x data-uri
(enter password when prompted) - Open Automator, choose New > Service.
- Set up the service as follows:
Service receives selectedfiles or folders
inFinder.app
which is connected to aRun Shell Script
action, with the following settings:
This file contains hidden or 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
... | |
// test for font-face version to load via Data URI'd CSS | |
// Basically, load WOFF unless it's android's default browser, which needs TTF, or ie8-, which needs eot | |
var fonts = ns.files.css.fontsWOFF, | |
ua = win.navigator.userAgent; | |
// android webkit browser, non-chrome | |
if( ua.indexOf( "Android" ) > -1 && ua.indexOf( "like Gecko" ) > -1 && ua.indexOf( "Chrome" ) === -1 ){ | |
fonts = ns.files.css.fontsTTF; | |
} |
- Open your Chrome Developer Tools
- Navigate to the Network tab
- Just right click into the panel and choose Copy ALL as HAR (maybe the page needs a reload)
- Switch to the console tab and save your HAR data in a variable. (
var data =
cmd + v) - Now let's create the cache manifest:
console.log('CACHE MANIFEST\n\nCACHE:');
This file contains hidden or 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
/* Lets not rely on paths in the database, they can be very wrong when moving between dev/stage/live environments */ | |
/* The following two variables are backward to my thinking, but hey, what ya gonna do? */ | |
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); // This is NOT the 'wordpress admin area' home, but the site's home | |
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/SECRETDIRECTORY'); // This isn't the site's URL but the WordPress admin area URL | |
/* MySQL settings */ | |
switch($_SERVER['SERVER_NAME']){ | |
// Your local machine's settings | |
case 'mysite.local': | |
define('DB_NAME', 'dev_mysite'); |
This file contains hidden or 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
/* | |
Older email clients and (some) webmail clients (Gmail!) will apply | |
this rule. Some clients (like older Lotus Notes) don't | |
support background-color on links, so I didn't want white | |
links on a white background. | |
*/ | |
a.button { | |
background-color: #FFFFFF; | |
color: #d9286b; | |
} |
This file contains hidden or 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
<head> | |
.... | |
</head> | |
<script> | |
(function( w ){ | |
var doc = w.document, | |
// quick async script inject | |
ref = doc.getElementsByTagName( "script" )[0], | |
loadJS = function( src ){ | |
var elem = doc.createElement( "script" ); |
NewerOlder