Skip to content

Instantly share code, notes, and snippets.

/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
'postOnly + delete', // we only allow deletion via POST request
array('ext.bootstrap.filters.BootstrapFilter - delete'),
);
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
'postOnly + delete', // we only allow deletion via POST request
array('ext.bootstrap.filters.BootstrapFilter - delete'),
);
@adlerdias
adlerdias / Mask.php
Last active January 23, 2019 12:54
mascara para cpf/cnpj/telefone
<?php
namespace App\Traits;
trait Mask
{
/**
* Clear the given string
*
* @param string $str
*
@adlerdias
adlerdias / typeahead.js-bootstrap3
Created July 13, 2017 18:54
css for typeahead js or corejavascript/typeahead
/*
* typehead.js-bootstrap3.less
* @version 0.2.3
* https://github.com/hyspace/typeahead.js-bootstrap3.less
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.has-warning .twitter-typeahead .tt-input,
.has-warning .twitter-typeahead .tt-hint {
@adlerdias
adlerdias / gist:ee94bcd3c76eb11cccae63353a0e266a
Created September 13, 2017 13:31
bootstrap responsive utilities
<div class="d-none d-sm-block"> hidden-xs
<div class="d-none d-md-block"> visible-md and up (hidden-sm and down)
<div class="d-none d-lg-block"> visible-lg and up (hidden-md and down)
<div class="d-none d-xl-block"> visible-xl </div>
</div>
</div>
</div>
<div class="d-sm-none"> eXtra Small <576px </div>
<div class="d-none d-sm-block d-md-none d-lg-none d-xl-none"> SMall ≥576px </div>
@adlerdias
adlerdias / .zshrc
Last active February 6, 2019 13:04
alias weather='curl -s wttr.in | sed -n "1,7p"'
alias update='sudo ntpdate ntp.nics.unicamp.br'
alias g='git'
alias gs='git status'
alias nah='git reset --hard;git clean -df'
alias d='docker'
alias dc='docker-compose'
alias dm='docker-machine'
alias artisan='php artisan'
alias serve='artisan serve'
@adlerdias
adlerdias / _ide_helper.php
Created July 30, 2018 16:53 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@adlerdias
adlerdias / DateHelper.php
Last active September 19, 2018 13:02
Check if a string is a valid date(time)
// ....
//
// Usage Example:
//
// var_dump($this->isValidDateTimeString('2018-13-10', 'Y-m-d')); # false
// var_dump($this->isValidDateTimeString('2018-12-10', 'Y-m-d')); # true
// var_dump($this->isValidDateTimeString('10/13/2018')); # false
// var_dump($this->isValidDateTimeString('10/12/2018')); # true
/**
@adlerdias
adlerdias / ClearString.php
Created September 26, 2018 12:43
PHP - Remove latin characters
namespace App\Helpers;
class Clear
{
/**
* Remove os caracteres acentuados da string
* @param string $string
* @return string
*/
public static function removerAcentuados(string $string) : string
@adlerdias
adlerdias / .vsls.json
Created January 3, 2019 18:10
Code Live Share - keep sensitive files away from the guests. You can exclude and include content by adding a .vsls.json file.
{
"$schema": "http://json.schemastore.org/vsls",
"gitignore":"exclude",
"excludeFiles":[
".env",
".vscode",
"!node_modules"
],
"hideFiles": [
"build",