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 | |
$row = 1; | |
$per_loop = 0; | |
$loop = 1; | |
$headers = array(); | |
$files = array(); | |
if (($handle = fopen("datos.csv", "r")) !== FALSE){ | |
while (($data = fgetcsv($handle, 0, ";")) !== FALSE) { | |
if ( $row === 1 ) $headers = $data; |
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
# instalar las herramientas de traducción de GNU. | |
# en Ubuntu están en el paquete gettext, en otras distribuciones puede tener otro nombre | |
sudo apt-get install gettext | |
# acceder a la carpeta donde están los archivos del proyecto | |
cd /var/www/proyecto/htdocs/wp-content/plugins/mi-plugin/ | |
# actualizar la plantilla de traducciones | |
php /var/www/i18n/makepot.php wp-plugin . l10n/dominio_de_traduccion.pot |
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
# Acceder al directorio donde vamos a obtener el repositorio | |
cd /var/www | |
# Copiar los contenidos del repositorio al directorio i18n | |
svn checkout http://svn.automattic.com/wordpress-i18n/tools/trunk/ i18n/ | |
# Acceder al directorio donde están los archivos que queremos traducir | |
cd /var/www/proyecto/htdocs/wp-content/plugins/mi-plugin | |
# Crear la carpeta donde se van a almacenar las traducciones |
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 | |
/** | |
* Para textos que pueden estar en singular o plural: _n( $singular, $plural, $numero, $dominio_de_traduccion ) | |
* printf() permite intercalar la variable con el número en el mensaje a traducir | |
*/ | |
printf( _n( 'Hay %d usuario activo.', 'Hay %d usuarios activos.', $count, 'dominio_de_traduccion' ), $count ); | |
/** | |
* Desambiguación por contexto |
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 | |
class EntriesOptions extends ArrayIterator{ | |
private $query; | |
private $cur_post; | |
public function __construct( $query_params = array(), $flags = array() ){ | |
$args = wp_parse_args( $query_params, array( | |
'post_status' => 'publish', | |
'orderby' => 'title', | |
'order' => 'ASC', |
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 | |
$abs_start = microtime(true); | |
$path = __DIR__; | |
$Directory = new RecursiveDirectoryIterator('.'); | |
$img_extensions = array('jpg', 'jpeg', 'gif', 'png'); |
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
# BEGIN WordPress | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# uploaded files | |
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] |
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
#!/bin/bash | |
# Daniel Verner | |
# CarrotPlant LLC | |
# 2011 | |
# Backup each mysql databases into a different file, rather than one big file | |
# Optionally files can be gzipped (dbname.gz) | |
# | |
# Usage: dump_all_databases [ -u username -o output_dir -z ] | |
# | |
# -u username to connect mysql server |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<proyectos> | |
<proyecto> | |
<descripcion> | |
<boletin>8575-05</boletin> | |
<titulo>Ley de Presupuestos del sector público para el año 2013.</titulo> | |
<fecha_ingreso>01/10/2012</fecha_ingreso> | |
<iniciativa>Mensaje</iniciativa> | |
<camara_origen>C.Diputados</camara_origen> | |
<urgencia_actual>Discusión inmediata</urgencia_actual> |
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
jQuery(document).ready(function($){ | |
$('.lightbox-img').fancybox({ | |
cyclic: true, | |
index: 0, | |
onStart: function(){ | |
}, | |
onComplete: function(){ | |
var wrap = $('#fancybox-wrap'), | |
outer = $('#fancybox-outer'), | |
width = outer.width(), |