./sublime_text --help Sublime Text 2 Build 2217
Usage: sublime_text [arguments] [files] edit the given files or: sublime_text [arguments] [directories] open the given directories
Arguments: --project : Load the given project
| public function getEstado($cep) | |
| { | |
| $estados = array('ac'=>'69900,69999', | |
| 'al'=>'57000,57999', | |
| 'am'=>'69000,69299|69400,69899', | |
| 'ap'=>'68900,68999', | |
| 'ba'=>'40000,48999', | |
| 'ce'=>'60000,63999', | |
| 'df'=>'70000,72799|73000,73699', | |
| 'es'=>'29000,29999', |
| # versao do nginx 1.8.0 | |
| server { | |
| listen 80; | |
| server_name ~^(www\.)?(?<sname>.+).local.com.br$; | |
| root /home/projetos/$sname; | |
| error_log /var/logs/$sname.error.log; | |
| access_log /var/logs/$sname.access.log; |
| ## colocar em /etc/nginx | |
| #ini - http://www.magentocommerce.com/magento-connect/speedster-by-fooman.html | |
| rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; | |
| rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; | |
| #fim - http://www.magentocommerce.com/magento-connect/speedster-by-fooman.html | |
| location ~* \.(eot|ttf|woff)$ { | |
| add_header Access-Control-Allow-Origin "*"; | |
| } |
| ## colocar em /etc/nginx | |
| ## php-fpm parsing | |
| location ~ .php$ { | |
| ## Catch 404s that try_files miss | |
| if (!-e $request_filename) { rewrite / /index.php last; } | |
| ## Disable cache for php files | |
| expires off; |
| # colocar em /etc/nginx | |
| ##turn on gzip compreesion | |
| gzip on; | |
| gzip_static on; | |
| gzip_comp_level 9; | |
| gzip_min_length 1100; | |
| gzip_types text/plain image/png image/gif image/jpeg application/x-javascript text/css text/xml application/xml application/xml+rss text/javascript; | |
| gzip_vary on; | |
| gzip_http_version 1.1; |
| ## http://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/ | |
| ## http://www.itzgeek.com/how-tos/linux/fedora-how-tos/nginx-php-fpm-mariadb-on-fedora-21.html | |
| ## Desabilitar o HTTPD ## | |
| systemctl disable httpd.service | |
| ## Habilitar o Nginx ## | |
| systemctl enable nginx.service | |
| ## Habilitar o FPM para não precisar ficar startando ## |
| ## Install OpenSSL ## | |
| yum install openssl openssl-deve | |
| ## Criar a pasta para criar os arquivos ## | |
| mkdir ~/domain.com.ssl/ | |
| cd ~/domain.com.ssl/ | |
| ## Criando o .KEY ## |
| ## Config ## | |
| # abrir as configurações do dnsmasq ( sudo vim /etc/dnsmasq.conf ) e adicionar # | |
| address=/local.com.br/127.0.0.1 | |
| # reiniciar o dnsmasq # | |
| sudo service dnsmasq restart | |
| # editar o arquivo ( /etc/resolv.conf ) para incluir o local nameserver # | |
| nameserver 127.0.0.1 |
| #!/bin/bash | |
| function startduration { | |
| TIMESTART=$(date +%s.%N) | |
| } | |
| function printduration { | |
| TEMPO=$(python -c "print($(date +%s.%N) - $1)") | |
| TEMPO=(${TEMPO//./ }) |