Skip to content

Instantly share code, notes, and snippets.

View SOSTheBlack's full-sized avatar
💻
Working

Jean C. Garcia SOSTheBlack

💻
Working
View GitHub Profile
@vitorleonel
vitorleonel / Helpers.php
Last active September 11, 2020 12:59
[Laravel] function to check if it is the current route and return a specific class for make item is active or no
<?php
if (! function_exists('currentRoute'))
{
/**
* Return class when is current route match passed name.
*
* @param string $name
* @param string $htmlClass
* @return string
@zabaala
zabaala / BindDatabaseServiceProvider.php
Last active March 2, 2021 07:50
php artisan db:log <start> <stop>
<?php
namespace App\Commands\Database;
use Illuminate\Support\ServiceProvider;
class BindDatabaseServiceProvider extends ServiceProvider
{
public function boot()
{
@rodurma
rodurma / filters.php
Created October 27, 2016 19:57
Filtros estilo GMail
<?php
$input = 'nome:ps4 sku:SKU7889-988;OI99129 data:10/12/2016 nome:Playstation 4 nome:Nintendo Wii sku:TESTE123 9aos';
preg_match_all('/(?:([^: ]+):)([^: ]+(?:\s+[^: ]+\b(?!:))*)/', $input, $matches, PREG_SET_ORDER);
echo $input;
echo '<pre>';
print_r($matches);
echo '</pre>';
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master