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

lunes, 20 de mayo de 2013

How do I make a semi transparent background? - css3


use rgba()

.transparent{
background:rgba(255,255,255,0.5);
}
This will give u 50% opacity while the content of the box will continue to have 100% opacity.

How to install mail in ubuntu server

How to install mail in ubuntu:

apt-get install sendmail-bin

 sudo sendmailconfig

martes, 14 de mayo de 2013

Codeigniter's url_title() change UTF8 Characters to specified Latin


Just tie into the convert_accented_characters function:

$this->load->helper('text');
url_title(convert_accented_characters('čolić'));

CodeIgniter global variable

It's not necessary to use global variable in codeigniter, you can do this:

class MY_Controller extends Controller {
  var $data;    
  //constructor function            
}

class Contact extends Controller { //to.. }

class Contact extends MY_Controller {
 $this->load->view('contact_view', $this->data);
}

lunes, 6 de mayo de 2013

Apache Restart / Stop


Restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart

If you are using Ubuntu use sudo:

$ sudo /etc/init.d/apache2 restart

To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop

$ sudo /etc/init.d/apache2 stop

To start Apache 2 web server, enter:

# /etc/init.d/apache2 start

$ sudo /etc/init.d/apache2 start

domingo, 5 de mayo de 2013

Downloading file from my server to my local


To download the file "serials.txt" from your remote home dir to the local computer:

scp user@server.com:serials.txt .

To download the remote file "something" using it's full path to your local computer:

scp user@server.com:/path/to/file/something.txt .

Now the tricky part: using the recursive switch (-r) to download a whole folder to your local computer. The issue you may have is that you DO NOT place a trailing forward slash after the directory name. For instance, this command will NOT work (notice the bold forward slash):

scp -r user@server.com:/path/to/directory/ .

This will give you a message saying the server is trying to write to the parent directory. REMOVE the last foward slash on the path and try again. The next command is CORRECT:

scp -r user@server.com:/path/to/directory .

I have been using a period when talking about downloading so far. Reason: this brings the file into the directory you are currently in. If you wish to take the last command and download it to somewhere else, the command would be:

scp -r user@server.com:/path/to/directory /new/local/location/

jueves, 25 de abril de 2013

How to remove all .svn directories from my application directories

find . -name .svn -exec rm -rf {} \;

Before running a command like that, I often like to run this first:

find . -name .svn -exec ls {} \;

Entradas populares