- jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
- AngularJS - Conventions based MVC framework for HTML5 apps.
- Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
- lawnchair - Key/value store adapter for indexdb, localStorage
This file contains 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
function otm_short_content( $length = 200 ) { | |
$content = strip_shortcodes( strip_tags( get_the_content(), '<p><h2><h3><h4>' ) ); | |
if ( strlen( $content ) > $length ){ | |
echo wpautop( substr( $content, 0, strpos( $content, ' ', $length ) ) . "..." ); | |
} else { | |
echo wpautop( $content ); | |
} |
This file contains 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
function otm_get_short_content($length = 200) { | |
$content = strip_shortcodes( strip_tags( get_the_content(), '<p><h2><h3><h4>' ) ); | |
if ( strlen( $content ) > $length ){ | |
return wpautop( substr( $content, 0, strpos( $content, ' ', $length ) ) . "..." ); | |
} else { | |
return wpautop( $content ); | |
} |
This file contains 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
/** | |
* Pre-populates a company ID into a Gravity Forms field from a GET variable | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter('gform_field_value_company_id', 'company_id_population'); | |
function company_id_population(){ | |
// if we have the proper company GET variable - set the return variable |
This file contains 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
/** | |
* Creates a dropdown field based on a returned SQL query of a custom db table | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter('gform_pre_render_7', 'populate_contacts'); // _7 relates this to a particular field | |
function populate_contacts( $form ){ | |
// Loop through fields |
This file contains 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
/** | |
* Custom validation so that a bid less than the minimum custom metabox is not allowed | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter( "gform_field_validation_10_1", "min_bid_validation", 10, 4 ); | |
function min_bid_validation( $result, $value, $form, $field ){ | |
// Get the correct output from the form |
This file contains 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
/** | |
* Get an auction id & info from Gravity Forms ID8 | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_action('gform_after_submission_8', 'ps_add_bid_card_from_form', 10, 2); // _8 means we're only grabbing data when the form ID8 is submitted | |
function ps_add_bid_card_from_form($entry, $form) { | |
// Get these two fields from fields ID2 & ID3 |
This file contains 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
/** | |
* Dual confirmation message | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter("gform_confirmation_10", "bid_confirmation", 10, 4); | |
function bid_confirmation( $confirmation, $form, $lead, $ajax ){ | |
// If this is the correct page, re-direct back to our page w/ lead info |
This file contains 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
{ | |
{I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. | |
{It’s|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website | |
owners|web owners} and bloggers made good content as you did, | |
the {internet|net|web} will be {much more|a lot more} useful than ever before.| | |
I {couldn’t|could not} {resist|refrain from} commenting. | |
{Very well|Perfectly|Well|Exceptionally well} written!| | |
{I will|I’ll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss | |
feed} as I {can not|can’t} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer