Skip to content

Instantly share code, notes, and snippets.

@benytocarlo
benytocarlo / vimeothumbail.js
Created May 19, 2013 03:41
Vimeo Thumbnail
$.ajax({
type:'GET',
url: 'http://vimeo.com/api/v2/video/' + video_id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
var thumbnail_src = data[0].thumbnail_large;
$('#thumb_wrapper').append('<img src="' + thumbnail_src + '"/>');
}
});
<style>
input[type=checkbox]:before { content:""; display:inline-block; width:12px; height:12px; background:red; }
input[type=checkbox]:checked:before { background:green; }
</style>
<input type="checkbox" id="chk1" /><br/>
<input type="checkbox" id="chk2" /> <label for="chk2">Some label</label>
@benytocarlo
benytocarlo / profileimgfb.html
Created May 19, 2013 05:17
Facebook Profile Cover
<img src="https://graph.facebook.com/UID/picture?type=square"/>
<img src="https://graph.facebook.com/UID/picture?type=small"/>
<img src="https://graph.facebook.com/UID/picture?type=large"/>
@benytocarlo
benytocarlo / gist:6197115
Created August 9, 2013 20:56
Custom Post Type y Modulos de Post en Wordpress
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
'add_new_item' => 'Add New Book',
'edit_item' => 'Edit Book',
'new_item' => 'New Book',
'all_items' => 'All Books',
'view_item' => 'View Book',
@benytocarlo
benytocarlo / gist:8539735
Created January 21, 2014 13:10
Order by meta_value
$args = array(
'showposts' => 20,
'post_type' => array( 'automoviles' ),
'meta_key' => 'Precio',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'post_parent' => $postid,
'tax_query' => array(
'relation' => 'AND',
array(
var _ga = _ga || {};
var _gaq = _gaq || [];
_ga.trackSocial = function(opt_pageUrl, opt_trackerName) {
twttr.ready(function (twttr) {
_ga.trackTwitter(opt_pageUrl, opt_trackerName);
});
};
_ga.trackTwitter = function(opt_pageUrl, opt_trackerName) {
var trackerName = _ga.buildTrackerName_(opt_trackerName);
try {
@benytocarlo
benytocarlo / placeholder-ie.js
Created May 7, 2014 20:02
Placeholder IE Fix
jQuery(function() {
jQuery.support.placeholder = false;
test = document.createElement('input');
if('placeholder' in test) jQuery.support.placeholder = true;
});
// This adds placeholder support to browsers that wouldn't otherwise support it.
$(function() {
if(!$.support.placeholder) {
var active = document.activeElement;
$(':text').focus(function () {
@benytocarlo
benytocarlo / functions.php
Created June 12, 2014 15:11
ocultar actualizaciones de Wordpress (Core/Plugins)
<?php
#esto se debe agregar al functions.php del theme
define( 'WP_AUTO_UPDATE_CORE', false );
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
?>
@benytocarlo
benytocarlo / mediamath.html
Created June 23, 2014 15:26
Tag event con MediaMath
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
@benytocarlo
benytocarlo / server_route.php
Created July 4, 2014 15:00
Ruta absoluta del servidor
<?php
echo dirname(__FILE__);
?>