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 |
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
[{ | |
"id": "571", | |
"type": "0", | |
"user": "RedAlertAdminApp-95.35.61", | |
"date": "09\/07\/2014 - 09:01:58", | |
"message": "Rockets Attack : Moatza Ezorit Eshkol", | |
"count": 9 | |
}, { | |
"id": "570", | |
"type": "0", |
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 | |
/* | |
Plugin Name: Just Give Me Berlin. | |
Plugin URI: http://www.berlin.de/en/ | |
Description: Berlin. Nuff said. | |
Author: A Berliner | |
Author URI: http://www.findme.in/berlin | |
Version: 0.0 | |
*/ |
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 maor_image_proportions_classes($attr, $attachment) { | |
$image = wp_get_attachment_image_src( $attachment->ID, 'full', false ); | |
if ( ! $image ) | |
return $attr; | |
list( $src, $width, $height ) = $image; | |
$attr['class'] .= ( $height > $width ) ? ' wp-image-portrait' : ' wp-image-landscape'; |
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
add_action( 'pre_get_posts', 'mc_modify_query_rand_posts' ); | |
function mc_modify_query_rand_posts( $query ) { | |
if ( ! is_admin() && $query->is_main_query() ) | |
$query->set( 'orderby', 'rand' ); | |
} |
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 | |
function maor_twitter_run_wp_user_search_query() { | |
/* There's a reason we're adding the action from here, you'll see later why. */ | |
add_action( 'pre_user_query', 'maor_twitter_help_main' ); | |
/* Create a new WP_User_Query object, limit recordset to 10 */ | |
$wp_user_search = new WP_User_Query( | |
array( | |
'number' => 10 |
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 | |
/* [http://on.fb.me/UAe3H9] */ | |
/* | |
* Posts that have the 'mc_order_key' custom field, and that their (numeric) value is low | |
* will be shown first. If you wish to reverse the order, change the 'order' parameter to | |
* 'DESC'. Also make sure to change the meta key. | |
*/ | |
function mc_reorder_search_results( $query ) { |
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 | |
/* Plugin Name: P2 Force Login | |
* Description: Force logged-out users to log-in in order to view the P2 | |
* Author: Maor Chasen | |
* Author URI: http://maorchasen.com/ | |
* Version: 1.0 | |
*/ | |
function p2fl_force_login() { | |
is_user_logged_in() || auth_redirect(); |
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
if ( $q['m'] ) { | |
$q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']); | |
$where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4); | |
if ( strlen($q['m']) > 5 ) | |
$where .= " AND MONTH($wpdb->posts.post_date)=" . substr($q['m'], 4, 2); | |
if ( strlen($q['m']) > 7 ) | |
$where .= " AND DAYOFMONTH($wpdb->posts.post_date)=" . substr($q['m'], 6, 2); | |
if ( strlen($q['m']) > 9 ) | |
$where .= " AND HOUR($wpdb->posts.post_date)=" . substr($q['m'], 8, 2); | |
if ( strlen($q['m']) > 11 ) |
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
/* RTL support for Jetpack's Comments Module */ | |
body.rtl #respond form { | |
direction: rtl; | |
} |
OlderNewer