This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function replace_between($str, $needle_start, $needle_end, $replacement = '') | |
{ | |
return preg_replace('/' . $needle_start . '.+?' . $needle_end . '/sm', $replacement, $str); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function strtocamel($str, $separator = '_', $replace = true) | |
{ | |
return str_replace($separator, $replace ? '' : $separator, ucwords($str, $separator)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function strtosnake($str) | |
{ | |
return ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $str)), '_'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Este script requer a função selectBoxByText do arquivo sayhicoelho/utils.js | |
// https://gist.github.com/sayhicoelho/be058ba559cba22b207a64c1113ff1bf | |
$(function () { | |
var request; | |
var timeout; | |
var campos = [ | |
'razao_social', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Este script requer a função selectBoxByText do arquivo sayhicoelho/utils.js | |
// https://gist.github.com/sayhicoelho/be058ba559cba22b207a64c1113ff1bf | |
$(function () { | |
var request; | |
var timeout; | |
var campos = [ | |
'logradouro', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove um elemento de um array pelo seu valor | |
Array.prototype.remove = function () { | |
var what, a = arguments, L = a.length, ax; | |
while (L && this.length) { | |
what = a[--L]; | |
while ((ax = this.indexOf(what)) !== -1) { | |
this.splice(ax, 1); | |
} | |
} | |
return this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace all non-number characters | |
* | |
* @param string $str | |
* @return string | |
*/ | |
function only_number($str) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
// FastClick | |
// https://github.com/ftlabs/fastclick | |
FastClick.attach(document.body); | |
// Stellar | |
// http://markdalgleish.com/projects/stellar.js/ | |
// Utilize o atributo data-stellar-background-ratio="0.5" no elemento que desejar o efeito parallax | |
$.stellar({ | |
horizontalScrolling: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
trait CheckRole | |
{ | |
/** | |
* The roles that belong to the user. | |
*/ | |
public function roles() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = document.getElementsByClassName('lists')[0]; | |
var min = 500; // ms | |
var max = 1500; // ms | |
var time = min; | |
var interval; | |
var timeout; | |
var invited = 0; | |
var limit = 999; | |
var stop = false; |
OlderNewer