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 / 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 / _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",
@adlerdias
adlerdias / node.md
Last active January 4, 2019 13:27
Ubuntu 18.04: Node with NVM

1 Install nvm

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

2 Only if using ZSH

@adlerdias
adlerdias / code.md
Last active January 4, 2019 13:28
Ubuntu 18.04: Visual Studio Code

1 Add Visual Studio Code PPA

$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
$ rm rm microsoft.gpg
$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'