Skip to content

Instantly share code, notes, and snippets.

View paulinhowoox's full-sized avatar

Paulo Aprimo junior paulinhowoox

View GitHub Profile
@olivertappin
olivertappin / update-phpstorm.sh
Created July 20, 2017 07:58
Download and install the latest version of PhpStorm for Ubunti
#!/bin/bash
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
echo "Downloading the latest PhpStorm to /tmp"
cd /tmp
function telefone_validation(telefone) {
//retira todos os caracteres menos os numeros
telefone = telefone.replace(/\D/g, '');
//verifica se tem a qtde de numero correto
if (!(telefone.length >= 10 && telefone.length <= 11)) return false;
//Se tiver 11 caracteres, verificar se começa com 9 o celular
if (telefone.length == 11 && parseInt(telefone.substring(2, 3)) != 9) return false;
@chrdesigner
chrdesigner / main.js
Last active September 14, 2017 21:12
Máscara em jQuery para o oite e nove dígitos
// <![CDATA[
jQuery(function($) {
$.mask.definitions['~']='[+-]';
//Inicio Mascara Telefone
$('input[type=tel]').focusout(function(){
var phone, element;
element = $(this);
element.unmask();
phone = element.val().replace(/\D/g, '');
if(phone.length > 10) {
@sadanandkenganal
sadanandkenganal / activelink_codeigniter.md
Last active April 3, 2022 12:24
Add active class to menu in codeigniter.
@willmendesneto
willmendesneto / Twig.php
Last active September 30, 2019 12:40
Inserindo Twig Template Engine no Codeigniter via Composer Localilzação dos arquivos: Twig.php => application/libraries/Twig.php Welcome.php => application/controller/Welcome.php autoload.php => application/config/autoload.php template.html.twig => application/views/template.html.twig index.html.twig => application/views/index.html.twig
<?php if (!defined('BASEPATH')) {exit('No direct script access allowed');}
/**
*
* Arquivo inserido em application/libraries/Twig.php
*
*/
class Twig {
/**
* Referência da instância da classe CodeIgniter