By: Jonas Nordström, @windyjonas
Date: 2013-04-16
esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:
| /* | |
| * Vanilla JS - Touch Gestures | |
| * @version 0.1 | |
| * @inspired QuoJS - http://quojs.tapquo.com | |
| * | |
| * Supported Gestures: singleTap, doubleTap, hold, | |
| * swipe, swiping, swipeLeft, swipeRight, swipeUp, swipeDown, | |
| * rotate, rotating, rotateLeft, rotateRight, pinch, pinching, | |
| * pinchIn, pinchOut, | |
| * drag, dragLeft, dragRight, dragUp, dragDown |
| /*! | |
| * classie - class helper functions | |
| * from bonzo https://github.com/ded/bonzo | |
| * | |
| * classie.has( elem, 'my-class' ) -> true/false | |
| * classie.add( elem, 'my-new-class' ) | |
| * classie.remove( elem, 'my-unwanted-class' ) | |
| */ | |
| /*jshint browser: true, strict: true, undef: true */ |
| <?php if ( has_post_thumbnail() ) :?> | |
| <a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array( | |
| 'alt' => trim(strip_tags( $post->post_title )), | |
| 'title' => trim(strip_tags( $post->post_title )), | |
| )); ?></a> | |
| <?php endif; ?> |
| (function($) { | |
| function parseImagesFromCSS(doc) { | |
| var i, j, | |
| rule, | |
| image, | |
| pattern = /url\((.*)\)/, | |
| properties = ['background-image', '-webkit-border-image'], | |
| images = {}; | |
| if (doc.styleSheets) { |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
| #------------------------------------------------------------------------ | |
| # encoding: utf-8 | |
| # @(#)product_generator.rb 1.00 29-Nov-2011 16:38 | |
| # | |
| # Copyright (c) 2011 Jim Pravetz. All Rights Reserved. | |
| # Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) | |
| # | |
| # Description: A generator that creates product, products and | |
| # ingredients pages for jekyll sites. Uses a JSON data | |
| # file as the database file from which to read and |
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |