This file contains hidden or 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 | |
/** | |
* Get document type based on the mime type | |
* (Loosely) based on wp_ext2type() on WordPress | |
* | |
* @param Object|string $attach WordPress object for an attachment or mime type | |
* @param boolean $echo Whether to echo (true) or return (false) the out | |
* @return string Three-letter file type, based on MIME-Type groups, or 'file' if there's no match | |
*/ |
This file contains hidden or 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
tallestTable = 0; | |
$('#team-list li').each(function(){ | |
if ( $(this).height() > tallestTable ) { tallestTable = $(this).height(); }; | |
}) | |
if (msie.msie6) $('#team-list li').css({'height': tallestTable}); | |
else $('#team-list li').css({'min-height': tallestTable}); |
This file contains hidden or 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
for i in *.png; do convert $i -resize 50x50 $i.jpg; done |
This file contains hidden or 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 | |
/** | |
* Get stuff ID by nicename | |
* @param $nicename string The nicename (i.e: post-slug) to get the ID for | |
* @param $type string The table that will be queried: posts (default), term, users | |
* @return integer The ID for the requested object, false if nothing found | |
*/ | |
function get_by_name($nicename, $type="posts"){ | |
global $wpdb; | |
if ( empty($type) OR $type === 'post'){ |
This file contains hidden or 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 | |
/** | |
* Return the request path, relative to the WP base URL | |
* @param boolean $return_parts Return as a string or an array | |
* @return string|array The relative request OR array with relative "directories" | |
*/ | |
function relativize_url($return_parts=true){ | |
$wp_url = get_bloginfo('url'); //base URL for this WordPress site | |
$wp_url_parts = parse_url($wp_url); // |
This file contains hidden or 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
/** | |
* A simple jQuery plugin to set sample content on text inputs | |
* and automatically clean it on focus | |
* @author Basilio Cáceres <[email protected]> | |
* @author Felipe Lavín <[email protected]> | |
*/ | |
jQuery.fn.buscDef = function() { | |
var orVal = jQuery(this).val(); | |
if ( jQuery.trim(orVal) != '' ) { | |
jQuery(this).data( 'defVal', orVal ) |
This file contains hidden or 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: Antispambot Shortcode | |
Plugin URI: http://yukei.net/proyectos/nospam-sc | |
Description: A simple plugin to use WordPress' antispambot() function in posts and pages | |
Version: 1.0 | |
Author: Felipe Lavin Z. | |
Author URI: http://www.yukei.net | |
*/ |
This file contains hidden or 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
/** | |
* A very simple class for some basic Date operations | |
* @author Felipe Lavín <www.yukei.net> | |
*/ | |
var dateHelper = { | |
arrToDate : function(arr, format){ | |
/** | |
* Convert an array to a Date object | |
* @argument arr {Array} An array containing at least day-month-year | |
* @argument format {String} An string representation of the date format. Default: dd-mm-yyyy. More could be added as necessary |
OlderNewer