- Download https://gist.github.com/jsocol/1089733 and unpack
- Rename
data-uri.pytodata-uriand 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 foldersinFinder.app
which is connected to aRun Shell Scriptaction, 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; | |
| } |
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