05
May 12

12 excelentes bancos de imágenes gratuitos

Actualmente existen un montón de opciones de bancos de imágenes para encontrar fotografías de diferentes tópicos. Esto es imprescindible para cualquier creativo tener distintos recursos. En la mayoría de los casos son de tipo pago y los valores de cada imagen son bastantes altos.

A continuación les dejo un listado de sitios de 12 banco de imágenes que son gratuitos y que tienen imágenes de excelente calidad, disfruten el siguiente listado:

  1. Stock xchng
  2. Morgue File
  3. Open Photo
  4. Photo Rack
  5. Unprofound
  6. Free Digital Photos
  7. Freerange Stock
  8. FreeFoto
  9. FreePixels
  10. Public Domain Photos
  11. DesingPacks
  12. Everystock Photo

Nos vemos a la próxima.


28
Apr 12

Redireccionar dominios con htaccess

Hace poco días aprendí algo que encuentro que es interesante compartir con ustedes. Tal como dice el dominio la opción de “re direccionar” los dominios con htaccess.

Para entender de forma clara esto, daré el siguiente ejemplo: al momento de ingresar a la dirección http://j0ny.cl, debería de forma automática direccionarme a http://www.jony.cl

Debemos agregar las siguientes sentencias en nuestro htaccess:

RewriteCond %{HTTP_HOST} ^sitio\.cl [NC]
RewriteRule ^(.*)$ http://www.sitio.cl/$1 [L,R=301]

Con esto dejaremos “seteada” la configuración de nuestro dominio.

Nos vemos a la próxima.


25
Feb 12

Imprimir, mostrar, debug una consulta a la base de datos en Zend Framework

Increíble como pasa el tiempo, pero quería actualizar mi blog, pero con algo muy de lo mío, es decir, siempre pequeños tips que pueden ayudarnos al “desarrollador web” a mejorar. Son esas cosas tan simples que muchas veces pueden parecer un poco complicadas.

Hoy les traigo como imprimir, mostrar o como se diría técnicamente “debug” de una consulta, utilizando Zend Framework. Vean el siguiente ejemplo y cualquier consulta es bien recibida o nuevas opciones:

$consulta = $this->select();
$consulta->from(array('b'=>'blog'),array('id_blog'=>'b.id_blog','titulo_blog'=>'b.titulo_blog','fecha_blog'=>'b.fecha_blog'));
$consulta->order('b.fecha_blog DESC');
Zend_Debug::dump($consulta->assemble()); die();

Se me olvido mencionar, que al parecer el método assemble(), solamente funciona en Zend_Db_Table, no estoy 100% seguro de esto, cuando lo verifique lo comentare.

Hasta la próxima!


18
Nov 11

Metodología de proyectos GTD (Getting Things Done)

Siempre creo caracterizarme por ir en busca de mejorar mis tiempos de respuesta desde el punto de vista profesional, tratando de innovar y buscar una mejor solución a mis conflictos domésticos o profesionales, tales como:

  1. ¿Cómo responder a todos mis proyectos?
  2. ¿Cómo ordenar las prioridades?
  3. ¿Cómo entregar y optimizar de mejor manera los tiempos de desarrollo?

Navegando por Internet, y buscando métodos de trabajo, optimización de tiempo, encontré uno que se denomina Metodología GTD (Getting Things Done).

GTD se basa en el principio de que una persona necesita borrar de su mente todas las tareas que tiene pendientes guardándolas en un lugar específico. De este modo, se libera a la mente del trabajo de recordar todo lo que hay que hacer, y se puede concentrar en la efectiva realización de aquellas tareas.

Esta metodología es bastante buena, cuando estas trabajando como desarrollador web o gestionando proyectos, liderando grupos de desarrollo, básicamente siempre cuando trabajas en el área de servicios, y necesitas responder a plazos de entrega.

Los siguientes puntos son bastantes buenos consejos o tips, que ayudan a encontrar la mejor manera de optimizar el tiempo en tu trabajo, para lograr mejores resultados:

  • Empezar siempre por el principio
  • No procesar más de un elemento a la vez.
  • No enviar de vuelta al “cubo” a ningún elemento.
  • Si un elemento requiere de una acción para ser realizado:
    • Si lleva menos de dos minutos, hazlo.
    • Si no es tu tarea, delégalo adecuadamente.
    • Posponlo.
  • Si un elemento no requiere una acción:
    • Archívalo como referencia.
    • Deséchalo si no es procedente.
    • Déjalo en cuarentena si no puedes llevarlo a cabo en ese momento.
  • Regla de los dos minutos: “Si una tarea requiere menos de dos minutos, hazla inmediatamente“. “Dos minutos” es una cifra orientativa, considerando que ese es también aproximadamente el tiempo que en cualquier caso habría que invertir para posponerla.
Al menos yo la voy a empezar a ocupar esta metodología, haber si alguien más tiene experiencia en otro metodo, para poder compartir experiencias.
Saludos.

Fuente: http://es.wikipedia.org/wiki/Getting_Things_Done


27
Oct 11

Build map with Google Maps JavaScript API v3

I always wanted to occupy the Google Maps API to build a simple map, or simply to understand how to work with an API. It happens that in previous versions of this API, it was all pretty cumbersome, a lot of code, many validation, verification code, among others.

We currently have a version 3, which is essentially pure javascript, add the library “core” of Google Maps, and then occupy the library and go with different parameters producing what we need, which is why the following example I want a little guide easily as building a map with Google Maps v3.

function loadmap(){
// Latitude and longitude
    var latlng = new google.maps.LatLng(1,1);
    var myOptions = {
      zoom: 16,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
// Assign the div where the map showed
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
// Add a Bookmark
    var marker = new google.maps.Marker({
          position: latlng,
          map: map,
          icon: '_includes/images/icon.png',
          title:"Your title"
      });
// Message when you click on the marker
    var infowindow = new google.maps.InfoWindow();
        infowindow.setContent('Your data');
        google.maps.event.addListener(marker, 'click', function() {
        infowindow.open(map, marker);
    });
}

Finally make the call on our map html as follows

<bod onLoad="loadmap()">
    <div id="map_canvas"></div>
</body>

Until next time.


30
Sep 11

Add time to a field in mysql table

I recently had to make a report on hours of work in the advertising agency I work for thiscrossing had to make tables and data to obtain the information required for management of the company.

The idea was to add the hours of work of the first half of the year for each of the workers and their customers. The problem was that the amount that was done was wrong, and taking the values ​​of a whole, for this I had to resort to my good friend Google and search mix and mergethe following functions to obtain the desired result.

SELECT
TIME_FORMAT(SEC_TO_TIME(SUM(TIME_TO_SEC(table.field))),'%H:%i') as hours
FROM table

Until next time.


23
Sep 11

Ping (status up or down) to a domain in php

Currently I have a resseller in a Chilean company that has web hosting services, the reseller is quite small and the main use I give you are personal developments as freelance developer. As been developing websites and platform management (CRM), also I have shared my space with some domains of known people, and in this same way has helped me pay the expenses of resseller, not so much what I charge, but if it helps me to pay and no money out of my pocket.

There are times when for various reasons the domain provider has to be ”down”, and oftenwork by topic I do not realize this, then to not have problems with my friends, and also to delivera “service” optimum, thought and research (Google) and create a domain ping returned me if the domain is working properly or was ”down”, there are a lot of code hanging around, but I wanted to create a painting and found me a simple exercise that works optimimanente and does what I require, which I share with you below:

/*
 * function valid if the domain is working properly
 * param: @dominio is string
 */
function ping($dominio){
    if(is_string($dominio)){
        $dato = @get_headers($dominio);
        if(is_array($dato)){
            return true;
        }else{
            return false;
        }
    }
}

Besides this, create an array of all my domains I need to monitor, and an array foreach and Itoured the domain asking for domain, if the function returns ”false”, send email notifying methat domain is down for revision . This obviously set a cronjob j0ny.cl in this field, I ammonitoring the notifications every 30 minutes, which will check if they consume significant bandwidth and hosting as a consequence of the reseller.

*
 * Function valid if the domain is working properly
 * Param: @dominio is string
 */
function ping($dominio){
    if(is_string($dominio)){
        $dato = @get_headers($dominio);
        if(is_array($dato)){
            return true;
        }else{
            return false;
        }
    }
}
/*
 * Array with a list of domains
 */
$dominios = array(
    'http://www.domain1.cl',
    'http://www.domain2.cl',
);
/*
 * Parameters to email headers
 */
$cabeceras  = 'MIME-Version: 1.0' . "\r\n";
$cabeceras .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$cabeceras .= 'From: Boot Domain <domain@j0ny.cl>' . "\r\n";
// It covers all the domains, and notifies the email if anyone is down.
foreach ($dominios AS $retorno){
    if(!ping($retorno)){
        $asunto = 'Domain '.$retorno.' down';
        $mensaje = 'Look at!';
        if(mail('mail@domain.com', $asunto, $mensaje,$cabeceras)){
            echo 1;
        }
    }
}

I await your serve them, is quite basic, but good!

Until next time.


21
Sep 11

Disable messages jquery validate – part two

Some time ago I wrote an article that made ​​reference to jquery validate an excellent plugin that helps you to easily validate forms and simple, and also added a sentence that helps eliminateerror messages and warning colors to add the input with css.

Today I bring a small change, perhaps without having to take this “sentence”, if not just pureCSS, tested it in Firefox, Chrome, IE 9, IE8 and IE7 … and it works perfectly, the idea is to addonly following in our stylesheet, and not display the messages and not mess up our forms.

label.error{
    display: none !important;
    visibility: hidden !important;
    width: 0px !important;
    height: 0px !important;
}

Until next time.


13
Sep 11

Check digit rut in PHP – Digito verificador

A classic of all time.

function dv($r){
    $s=1;
    for($m=0;$r!=0;$r/=10){
        $s=($s+$r%10*(9-$m++%6))%11;
    }
    return chr($s?$s+47:75);
}
$rut = '17044434';
$digito = dv($rut);
echo $rutcompleto = $rut.'-'.$digito;

Until next time.


08
Aug 11

jQuery UI – Datepicker Spanish language es-CL

JQuery libraries are very useful, it helps to optimize the time, I always hear often but not always take into account web developers is that there is no need to reinvent the wheel, better to use something created and used.

In this case to fill the resource named “datepicker” that helps to add a calendar on a form in a text input, the default is coming is in English, and sometimes by tricks of the client, we transform the date into a readable and understandable language, which is why then leave the setting es-CL (Chile) for the datepicker calendar.

   $('#datepicker').datepicker();
    // datepicker - language espanol-chile
    jQuery(function($){
        $.datepicker.regional['es-cl'] = {
        closeText: 'Cerrar',
        prevText: 'Ant',
        nextText: 'Sig',
        currentText: 'Hoy',
        monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
        monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],
        dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'],
        dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
        dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
        weekHeader: 'Sm',
        dateFormat: 'dd-mm-yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
        $.datepicker.setDefaults($.datepicker.regional['es-cl']);
    });

Until next time.