View gist:8778594
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
View gist:8778605
$("#content").load("somefile.html");
View gist:8778610
var maxheight = 0;
$("div.col").each(function(){
if($(this).height() > maxheight) { maxheight = $(this).height(); }
});
$("div.col").height(maxheight);
View gist:8778622
setInterval(function() {
$("#refresh").load(location.href+" #refresh>*","");
}, 10000); // milliseconds to wait
View Urlmask
<body style="padding:0; margin:0;height:100%;overflow:hidden"><iframe src="http://nodws.com" style="height: 100%;width:100% " allowtransparency="true" frameborder="0"></iframe></body>
View embed
function initFbEmbedPosts(){
jQuery('.embed-fb-comments').each(function(i,e){
var comment = jQuery(e);
var postId = comment.attr('data-post-id');
//you will need the div with attribute data-post-id
//You can also make this get the ID from the fb embed post element
jQuery.getJSON('https://graph.facebook.com/'+ postId +'/comments', null, function(data){
for (obj in data.data) {
View wordpress
$arr = Array(
'post_type'=>'post',
'posts_per_page'=>9,
'cat'=>107
);
$q= new WP_Query( $arr );
while ( $q->have_posts() ) : $q->the_post();
$meta = get_post_meta( get_the_ID() );
$tel = $meta['wpcf-telefono'][0];
View gist:6123579
find . -type f -printf "%C@ %p\n" | sort -rn | head -n 10
View gist:6123598
#add prefix
rename s/'^'/'MyPrefix'/ *
#add suffix
rename s/'$'/'MySuffix'/ *
View gist:6123647
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail('medium');
else:
$attachments = get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order')); //you may need to change that $post variable
if (is_array($attachments) ){
$first_attachment = array_shift($attachments);
echo wp_get_attachment_image($first_attachment->ID,'medium');
}
else{