#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| /* Simple spam protection for email addresses using jQuery. | |
| * Well, the protection isn’t jQuery-based, but you get the idea. | |
| * This snippet allows you to slightly ‘obfuscate’ email addresses to make it harder for spambots to harvest them, while still offering a readable address to your visitors. | |
| * E.g. | |
| * <a href="mailto:foo(at)example(dot)com">foo at example dot com</a> | |
| * → | |
| * <a href="mailto:foo@example.com">foo@example.com</a> | |
| */ | |
| $(function() { |
| <?php | |
| /** | |
| * UUID class | |
| * | |
| * The following class generates VALID RFC 4122 COMPLIANT | |
| * Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
| * | |
| * UUIDs generated validates using OSSP UUID Tool, and output | |
| * for named-based UUIDs are exactly the same. This is a pure | |
| * PHP implementation. |
| (function(){ | |
| var button_id = "download" | |
| // include this code in your page | |
| // you must have jQuery installed | |
| // you must have a link element with an id of "download" | |
| // this is limited to only one chart on the page (the first) | |
| function encode_as_link(){ | |
| // Add some critical information |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| <!doctype html> | |
| <!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
| <html> | |
| <head> | |
| <title>iOS 8 web app</title> | |
| <!-- CONFIGURATION --> |
| <?php | |
| /* | |
| DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED! | |
| */ | |
| ini_set( 'display_errors', 1 ); | |
| error_reporting( E_ALL ); | |
| $from = 'webmaster@example.com'; |
| <?php | |
| /** Loop through all the files in a folder **/ | |
| function loop_through_folder_by_extension($path, $extension) { | |
| $processedFiles = array(); | |
| $errors = array(); | |
| foreach ( "{$path}/*.{$extension}" as $filename ) { |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| <? | |
| function rgbToHsl( $r, $g, $b ) { | |
| $oldR = $r; | |
| $oldG = $g; | |
| $oldB = $b; | |
| $r /= 255; | |
| $g /= 255; | |
| $b /= 255; |