Skip to content

Instantly share code, notes, and snippets.

View diegocuruma's full-sized avatar

Diego Curumim diegocuruma

View GitHub Profile
@felipemarcos
felipemarcos / wp-cpf-login.php
Last active July 3, 2023 15:12
Permitir login por CPF - WordPress
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Plugin Name: Login por CPF
* Description: Permite o usuário se logar utilizando o CPF.
* Author: Felipe Marcos
* Author URI: https://felipe.zip
* License: GNU General Public License v3 or later
@OleksandrLz
OleksandrLz / cut-text
Created December 10, 2016 09:54
cut long text
<!-- html code -->
<div class="news-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Facere nostrum neque quae aliquid magnam quibusdam nesciunt,
totam sit, autem quas accusamus
</div>
// js code
var size = 10,
newsContent= $('.news-content'),
newsText = newsContent.text();
@marcosbrasil
marcosbrasil / text_cut.php
Created June 21, 2012 13:54
FUnção PHP para limitar texto sem cortar palavras
<?php
function limitarTexto($texto, $limite){
$texto = substr($texto, 0, strrpos(substr($texto, 0, $limite), ' ')) . '...';
return $texto;
}
// String a ser limitada
$string = 'Como limitar caracteres sem cortar as palavras com PHP';
// Mostrando a string limitada em 25 caracteres.
@ografael
ografael / combo_dinamico.html
Created March 14, 2012 15:12
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) {