Skip to content

Instantly share code, notes, and snippets.


Elton Nicolau elton182

View GitHub Profile
elton182 / validaContaSantander.js
Created Aug 5, 2019
Validação Digito Conta Corrente Santander
View validaContaSantander.js
var agencia = '0189'
var conta = '01017417'
var dig = 9
var retorno = validaSantander(agencia,conta,dig);
function validaSantander(agencia, conta, digito){
elton182 / datatablefilter.blade.php
Created Dec 8, 2017
datatable com filtros em colunas
View datatablefilter.blade.php
<div class="table-responsive">
<table class="table table-bordered table-striped table-responsive" id="table" cellpadding="0" cellspacing="0" width="100%">
<th>Data Nascimento</th>
elton182 / env.php
Last active Sep 18, 2017
Função para usar um arquivo como arquivo de ambiente (environment)
View env.php
* retorna uma variavel de ambiente do arquivo .env
* @param [type] $var
* @return string
function env($var)
elton182 / gulpfile.js
Created Sep 17, 2017
Gulp File para compilar os assets no cake
View gulpfile.js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var cssnano = require('gulp-cssnano');
var copy = require('gulp-copy');
gulp.task('minify-js', function () {
elton182 / template.php
Created Aug 14, 2017
logica que faz o parse de valores {{name}}
View template.php
function resolveTemplate($template,$data){
// search pattern
$pattern = '/{{([^}]+)}}/';
$callback = function ($match) use($data){
$string = trim($match[1]);
View create.blade.php
<script type="text/javascript">
prefix: "R$: ",
decimal: ",",
View fluig_datepicker.html
<div class="form-group">
<label for="only-date">Data Emissão</label>
<div class="input-group date" id="dataEmissao">
<input type="text" class="form-control" placeholder="Informe a data de emissão" name="dataEmissao">
<span class="input-group-addon">
<span class="fluigicon fluigicon-calendar"></span>
View CategoryControllerTest.php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use App\User;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
elton182 / Model.php
Last active Jun 5, 2017
Validar Data no CakePHP
View Model.php
->add('occurrence_date', 'custom', [
'rule' => function ($value, $context) {
$dia = intval(substr($value, 0,2));
$mes = intval(substr($value, 3,2));
$ano = intval(substr($value, 6,4));
elton182 / PermissionMiddleWare
Last active Apr 20, 2017
Permission Middleware
View PermissionMiddleWare
namespace safed\Http\Middleware;
use Artesaos\Defender\Facades\Defender;
use Closure;
class Permission