Skip to content

Instantly share code, notes, and snippets.

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

Pablo Erick pabloprogramador

🏠
Working from home
View GitHub Profile
@pabloprogramador
pabloprogramador / droplist-estados-brasil
Created April 14, 2015 14:02
droplist estados brasil
@Html.DropDownListFor(model => model.ESTADO, new SelectList(
new List<Object>{
new { value="AC" , text = "ACRE" },
new { value="AL" , text = "ALAGOAS" },
new { value="AM" , text = "AMAZONAS" },
new { value="AP" , text = "AMAPÁ" },
new { value="BA" , text = "BAHIA" },
new { value="CE" , text = "CEARÁ" },
new { value="DF" , text = "DISTRITO FEDERAL" },
new { value="ES" , text = "ESPÍRITO SANTO" },
document.getElementById("DATA_NASCIMENTO").valueAsDate = new Date(parseInt(data.DATA_NASCIMENTO.replace(/(^.*\()|([+-].*$)/g, '')));
@pabloprogramador
pabloprogramador / web.config
Created November 14, 2014 09:58
REMOVER WWW URL
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Remove WWW" stopProcessing="true">
@helper StripTags(string conteudo, int quantidade = 0){
string noHTML = System.Text.RegularExpressions.Regex.Replace(conteudo, @"<[^>]+>|&nbsp;", "").Trim();
noHTML = System.Web.HttpUtility.HtmlDecode(noHTML);
if(quantidade > 0){
noHTML = noHTML.Substring(0, quantidade > noHTML.Length ? noHTML.Length : quantidade);
}
@System.Web.HttpUtility.HtmlDecode(noHTML)
}
@pabloprogramador
pabloprogramador / mustache
Created December 19, 2013 11:22
Mustache
<?php
$vars = array(
'cumprimento' => $this->_saudacao(),
'cliente' => $cliente->NOME_CLIENTE,
'tratamento' => $cliente->SEXO ? 'Senhora' : 'Senhor',
'atendente' => $_SESSION['nomeUsuario'],
'botao_financeiro' => '<a href="#?keepThis=true&TB_iframe=true&height=400&width=700" class="botao thickbox">Verificar Valores</a>'
);
$mustache = function ($valor,$vars){
@pabloprogramador
pabloprogramador / ajax.html
Last active December 28, 2015 14:09
ajax
<form id="formAmigo" action="" method="post">
<input name="seu_nome" type="text" data-required/>
<input name="seu_email" type="text" data-required data-pattern="^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$"/>
</form>
<script>
$(document).ready(function(){
$('#formAmigo').validate({
sendForm: false,
onKeyup: true,
valid: function() {
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57'></input>
</body>
</html>
@pabloprogramador
pabloprogramador / pagination.css
Created October 5, 2013 01:50
Pagination css
.pagination {float: left; width: 100%; text-align:center; margin:20px 0px 20px 0px;}
.pagination ul li {cursor:pointer; text-align: center; display: inline-block; color: #666; background: #eee; width: 25px; height: 30px; line-height: 30px; font-weight: bold; border: solid 1px #ccc; margin: 0 3px; border-radius:2px;}
.pagination ul li:hover {color: #666; background: #fff; border: solid 1px #aaa;}
.pagination ul li a {color:#666; }
.pagination ul li.active {color: #666; background: #ccc;}
@pabloprogramador
pabloprogramador / routes.php
Created September 19, 2013 19:14
Routes rotas config
<?php
$route['default_controller'] = 'loja/home';
$route['404_override'] = 'pages';
$route['admin/help/([a-zA-Z0-9_-]+)'] = 'admin/help/$1';
$route['admin/([a-zA-Z0-9_-]+)/(:any)'] = '$1/admin/$2';
$route['admin/(login|logout|remove_installer_directory)'] = 'admin/$1';
$route['admin/([a-zA-Z0-9_-]+)'] = '$1/admin/index';
$route['api/ajax/(:any)'] = 'api/ajax/$1';