Skip to content

Instantly share code, notes, and snippets.

View diegocuruma's full-sized avatar

Diego Curumim diegocuruma

View GitHub Profile
/**
* Limitar número caracteres conteúdo, MAS NÃO CORTA A PALAVRA AO MEIO
**/
function limitarTexto($content, $limite)
{
$contador = strlen($content);
if ($contador >= $limite) {
$content = substr($content, 0, strrpos(substr($content, 0, $limite), ' ')) . '...';
return $content;
} else {
@diegocuruma
diegocuruma / combo_dinamico.html
Created July 30, 2017 15:00 — forked from ografael/combo_dinamico.html
Carregar combo com JQuery - Cidades e Estados
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('estados_cidades.json', function (data) {
@diegocuruma
diegocuruma / @css back
Last active August 29, 2015 14:11
@each para background dinâmico
.page-quem-somos .cont:before {
content: "";
position: absolute;
width: 100%;
height: 250px;
background: url("../images/bg-interno.jpg") no-repeat;
background-position: left 0px;
}
.page-promocoes .cont:before {
@diegocuruma
diegocuruma / Example Each Sass (scss)
Created August 29, 2014 14:33
Examplo de each com zip simples em sass
$ids: 'Blue', 'Green', 'Purple';
$cores: red, yellow, gray;
$cores2: orange, white, black;
$tema: zip($ids,$cores, $cores2);
@each $elemento in $tema {
##{nth($elemento, 1)} {
.bloc-2{
@diegocuruma
diegocuruma / SassMeister-input.scss
Created August 7, 2014 20:59
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
@function col( $col ) {
$cem: 100%;
$valor: $cem / $col - 2%;
@return $valor;
}