I hereby claim:
- I am caratage on github.
- I am caratage (https://keybase.io/caratage) on keybase.
- I have a public key ASCFS7elX_L7uAoF9l42kY56fQSakUaueh0-QYRY9w8Lpwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public class Example { | |
private int value; | |
//getters and setters, constructor | |
@Override | |
public boolean equals(Object o) { | |
// same address | |
if (o == this) return true; | |
// other type | |
if (!(o instanceof Example)) { | |
return false; |
#!/bin/sh | |
mkdir ${TMPDIR}/com.apple.IconServices |
var someImg = $("#someId"); | |
if (someImg.width() > someImg.height()){ | |
//it's a landscape | |
} else if (someImg.width() < someImg.height()){ | |
//it's a portrait | |
} else { | |
//image width and height are equal, therefore it is square. | |
} |
if (is_object_in_term( $post->ID, 'taxonomy-slug' )) { | |
// do something | |
} |
/********************************************** | |
* Custom Password Form | |
**********************************************/ | |
add_filter( 'the_password_form', 'custom_password_form' ); | |
function custom_password_form() { | |
global $post; | |
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); | |
$o = '<form class="protected-post-form form-inline" action="' . get_option('siteurl') . '/wp-login.php?action=postpass" method="post"> | |
/********************************************** | |
* Sort columns for TOUR DATE post type | |
**********************************************/ | |
function set_date_post_types_admin_order($wp_query) { | |
if (is_admin()) { | |
// Get the post type from the query | |
$post_type = $wp_query->query['post_type']; |
function get_attachment_id_from_src ($src) { | |
global $wpdb; | |
$reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i"; | |
$src1 = preg_replace($reg,'',$src); | |
if($src1 != $src){ | |
$ext = pathinfo($src, PATHINFO_EXTENSION); | |
$src = $src1 . '.' .$ext; | |
} | |
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$src'"; | |
$id = $wpdb->get_var($query); |
// http://www.binarymoon.co.uk/2010/03/5-wordpress-queryposts-tips/ | |
<?php | |
$query = 'posts_per_page=10'; | |
$queryObject = new WP_Query($query); | |
// The Loop... | |
if ($queryObject->have_posts()) { | |
while ($queryObject->have_posts()) { | |
$queryObject->the_post(); | |
the_title(); |