- 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
<?php | |
// Remove the default buttons display | |
function nl_april_choulat_remove_default_share() { | |
remove_filter( 'the_content', 'sharing_display', 19 ); | |
remove_filter( 'the_excerpt', 'sharing_display', 19 ); | |
} | |
// Hooked on both actions to prevent showing it on both posts/pages AND other content that's filtered with 'the_content' | |
add_action( 'loop_start', 'nl_april_choulat_remove_default_share' ); |
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
/***** Make external links open in new browser window/tab *****/ | |
$('a').each(function() { | |
var a = new RegExp('/' + window.location.host + '/'); | |
if( ! a.test( this.href ) ) { | |
$( this ).click( function( event ) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
window.open( this.href, '_blank' ); | |
}); | |
} |
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 jewish_food_hero_get_best_image( $size = 'full' ) { | |
$image_data = array(); | |
if ( has_post_thumbnail() ) { | |
$image_id = get_post_thumbnail_id(); | |
$image_data_raw = wp_get_attachment_image_src($image_id, $size); | |
$image_data['url'] = $image_data_raw[0]; | |
$image_data['width'] = $image_data_raw[1]; | |
$image_data['height'] = $image_data_raw[2]; | |
} else { |
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
.grow { | |
@include transition( all 400ms ease-in-out ); | |
&:hover { | |
@include transform( scale(1.1) ); | |
} | |
} |
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
#!/usr/bin/env python | |
""" | |
Quick script to beemind entering at least some meals into MyFitnessPal for the day. | |
Setup instructions: | |
- install myfitnesspal, requests and keyring (if you don't have them) | |
- call keyring.set_password("myfitnesspal", <your_username>, <your_password>) | |
- call keyring.set_password("beeminder", <your_username>, <your_api_key>) |
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
jQuery( document ).ready( function( $ ) { | |
var moveMarketoRichMediaAround = function() { | |
var wrapperClass = '.RTP_RCMD2'; | |
var pageWidth = $( 'body' ).width(); | |
var targetSmallScreens = '.default-page-content > .fl-node-content'; | |
var targetLargeScreens = '.marketo-rich-media > .custom-html-widget'; | |
if ( 769 <= pageWidth ) { | |
// It's two-column, so put it in the sidebar widget if it's not already there |
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
jQuery( 'table.wp-list-table.widefat.fixed.posts tr' ).css( 'display', 'table-row' ); | |
jQuery( 'tbody[id^="fix-duplicates-group-"]' ).each( function() { | |
var rowWrapper = jQuery( this ); | |
var matchingDateCount = 0; | |
var dates = new Array(); | |
var matchedDates = new Array(); | |
var dateCount = rowWrapper.find( 'tr td.date abbr' ).length; | |
rowWrapper.find( 'tr td.date abbr' ).each( function() { | |
var currentDate = jQuery( this ).text(); |
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
<?php | |
/** | |
* Register our custom taxonomy. | |
* | |
* @return void | |
*/ | |
function gist_5f2e8bcd3217698fb4947e120f178686_custom_tax_init() { | |
// Set some options for our new custom taxonomy. | |
$args = array( | |
'label' => __( 'My Custom Taxonomy' ), |
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
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts wp ON wp.ID = pm.meta_value | |
WHERE wp.ID IS NULL AND pm.meta_key = '_thumbnail_id'; |
OlderNewer