How To Backup MySQL database
backup:
# mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
restore:
# mysql -u root -p[root_password] [database_name] > dumpfilename.sql
jueves, 6 de junio de 2013
martes, 4 de junio de 2013
How can I change the default width of a Twitter Bootstrap modal box?
body .modal-admin {
/* new custom width */
width: 750px;
/* must be half of the width, minus scrollbar on the left (30px) */
margin-left: -375px; }
/* new custom width */
width: 750px;
/* must be half of the width, minus scrollbar on the left (30px) */
margin-left: -375px; }
jueves, 30 de mayo de 2013
Guardar imagen en codeigniter
public function guardarImagen($object){
$directorio = IMG_PATH.'/'.$object->directorio.'/';
$nombre_imagen = $object->nombre_imagen;
$ext = $object->ext;
$field_name = $object->field_name;
$config['upload_path'] = $directorio;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '15000';
$config['encrypt_name'] = FALSE;
$config['overwrite'] = FALSE;
$config['file_name'] = $nombre_imagen.'.'.$ext;
$this->load->library('upload');
$this->upload->initialize($config);
$data = array();
if(!$this->upload->do_upload($field_name)){
$this->upload->display_errors();
}else{
$data = $this->upload->data();
}
return $data;
}
martes, 28 de mayo de 2013
jQuery Validate img - add method
Create / add a new method:
jQuery.validator.addMethod("imgType", function(value, element) {
var extension = value.substr( (value.lastIndexOf('.') +1) );
if(extension=='jpg' || extension=='gif' || extension=='png'){
return true;
}else{
return false;
}
}, "=$this->lang->line('error_img')?>");
rules:{
inputImg: {required:true,imgType:true}
}
lunes, 27 de mayo de 2013
domingo, 26 de mayo de 2013
Free Android Application Development Tutorial - Beginner Level
Free Android Application Development Tutorial - Beginner Level
Start learning android developing
viernes, 24 de mayo de 2013
Use multiple custom fonts using @font-face?
You only have to include diferents @font-face
@font-face {
font-family: CustomFont;
src: url('CustomFont.ttf');
}
@font-face {
font-family: CustomFont2;
src: url('CustomFont2.ttf');
}
@font-face {
font-family: CustomFont;
src: url('CustomFont.ttf');
}
@font-face {
font-family: CustomFont2;
src: url('CustomFont2.ttf');
}
miércoles, 22 de mayo de 2013
Actualizar página en codeigniter
Cambiando las cabeceras conseguimos que se refresque la página sin tener que forzar una recarga de nuestro navegador.
$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
martes, 21 de mayo de 2013
Google maps in codeigniter
CodeIgniter Google Maps API V3 Class
Displays a Google Map
@package CodeIgniter
@subpackage Libraries
@category Libraries
@author BIOSTALL (Steve Marks)
@link http://biostall.com/codeigniter-google-maps-v3-api-library
@docs http://biostall.com/wp-content/uploads/2010/07/Google_Maps_V3_API_Documentation.pdf
Suscribirse a:
Entradas (Atom)
Entradas populares
-
¿Cómo usar clases anidadas en CSS ? Para que nos entendamos, usar clases anidadas o identificadores anidados quiere decir poner varias propi...
-
Cambiando las cabeceras conseguimos que se refresque la página sin tener que forzar una recarga de nuestro navegador. $this-...
-
Do you remember when people would talk about ways to do things on your computer without using the mouse? Well, even though times are changin...
-
¿Qué es una expresión regular ? Una expresión regular , a menudo llamada también patrón, es una expresión que describe un conjunto de cade...
-
Crontab is a program used in linux to execute schedule scripts. If you need to run one script after rebooting the server you can use @reboot...
-
public function guardarImagen($object){ $directorio = IMG_PATH. '/' .$object-> directorio . '/' ; $n...
-
Recuperar lista de paquetes instalados En muchas ocasiones tenemos la necesidad de replicar una instalación en varios puestos de trabajo. ...
-
It's not necessary to use global variable in codeigniter, you can do this: class MY_Controller extends Controller { var $data; ...
-
Cómo ver todas las contraseñas guardadas en Chrome chrome://settings/passwords
-
You can upload files to the server using the following syntax: scp SourceFile user@host:directory/TargetFile
