Skip to content

Instantly share code, notes, and snippets.

View knoonrx's full-sized avatar
🎯
Focusing

Rodrigo Brandão knoonrx

🎯
Focusing
View GitHub Profile
@knoonrx
knoonrx / Extenso.php
Last active December 28, 2022 09:33
Converte números e exibe por extenso em php Fonte: http://www.dirceuresende.com/blog/escrevendo-numero-por-extenso-no-php/
<?php
/**
* Created by PhpStorm.
* User: Rodrigo Brandão
* Date: 21/03/2016
* Time: 11:07
*/
class Extenso
{
public static function removerFormatacaoNumero( $strNumero )
@knoonrx
knoonrx / nove_digitos.js
Created January 7, 2016 13:00
Regex para formatar números de telefone 10 ou 11 caracteres (9 dígitos)
var numero = 2199999999;
var formatNumber;
formatNumber = numero.length === 11 ? numero.match(/(\d{2})(\d{5})(\d{4})/) : numero.match(/(\d{2})(\d{4})(\d{4})/);
var finalNumber = '('+ formatNumber[1]+') '+formatNumber[2]+' - '+formatNumber[3];
@knoonrx
knoonrx / header.html
Last active January 7, 2016 02:01
Bootstrap 3 double line
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="collapse navbar-collapse col-lg-6 col-md-6">
<ul class="nav navbar-nav nav-logo navbar-left">
<li><a href="#"><img src="<?= bloginfo( 'template_url' ) ?>/images/favicon.png"></a></li>
</ul>
</div>
<div class="collapse navbar-collapse navbar-right col-lg-6 col-md-6">
@knoonrx
knoonrx / autoloader.php
Last active April 13, 2017 12:34
Autoloader for wordpress theme
<?php
/**
* WordPress Theme Autoload
* Place on Root Theme
* Create a folder as classes
* This peace of code adds a autoloader into any wordpress theme you have
* to use this only follow the simple steps bellow
* create all your class files inside the folder named class
* and then just include this autoloader.php file in your theme functions.php
* require_once TEMPLATEPATH . '/autoloader.php';