Skip to content

Instantly share code, notes, and snippets.

View vluzrmos's full-sized avatar
🏠
Working from home

Vagner Luz do Carmo vluzrmos

🏠
Working from home
View GitHub Profile
@vluzrmos
vluzrmos / po.md
Created December 28, 2014 10:01
poedit

Editando arquivos .po

nano file.po

Compilando

msgfmt -cv -o file.mo file.po
@vluzrmos
vluzrmos / bootstrap-extend.css
Last active August 29, 2015 14:12
Estende as funcionalidades do Twitter Boostrap
/*
Permite truncar o texto das celulas e fixar a largura da tabela
*/
.table-truncated {
table-layout: fixed;
}
.table-truncated td{
white-space: nowrap;
@vluzrmos
vluzrmos / .htaccess
Last active September 21, 2017 22:45 — forked from dr-dimitru/.htaccess
Laravel 4.2 HTACCESS
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@vluzrmos
vluzrmos / my.ini
Last active August 29, 2015 14:10
Configuração do MySQL Server para aceitas arquivos grandes
[client]
...
max_allowed_packet=64M
[mysqld]
...
key_buffer=16M
max_allowed_packet=64M
sort_buffer_size=512K
net_buffer_length=8K
@vluzrmos
vluzrmos / form_builder_select.rb
Last active August 29, 2015 14:08
Customizando o select do Tora
<%
tipo_ocor = {
:association => f.object.class.reflect_on_association(:tipo_ocorrencia),
:options => {:include_blank => true},
:html_options => {
:onchange => remote_function(:url => {
:controller => "advocacia/processos",
:action => "campos_tipo_ocorrencia",
:index => index
},
@vluzrmos
vluzrmos / laravel_redirect_back.php
Last active August 29, 2015 14:05
Laravel Helper para redirecionar o usuário devolta para a última página ou para um lugar default.
<?php
function redirect_back_or_default($url = null){
try{
return Redirect::back();
}catch(Exception $e){
return Redirect::to($url);
}
}
@vluzrmos
vluzrmos / json.php
Last active August 29, 2015 14:02
Exemplo da utilização do json_encode do PHP
<?php
$pessoa = array(
"nome" => "Pessoa 1",
"sobrenome" => "da Silva"
);
echo json_encode($pessoa); // Vai gerar {"nome":"Pessoa 1", "sobrenome":"da Silva"}
// Se vc quiser um array de pessoas ...