Skip to content

Instantly share code, notes, and snippets.

🌌
Wake up!

Lucas Pires flyingluscas

🌌
Wake up!
Block or report user

Report or block flyingluscas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@flyingluscas
flyingluscas / RandomCrap.md
Last active Oct 3, 2016
Códigos Marotos da Vida (não é meu, só achei jogado nuns projeto por ae, é importante para mim que você saiba disso)
View RandomCrap.md

Compilado de Bosta

	if($id_insert)
        {
			$return['status']   = 'okay';
			$return['redirect'] = base_url('admin/' . $this->module['name'] . '/newsletter');

			$this->template_lib->set_message('Registro criado com sucesso', 'success');
@flyingluscas
flyingluscas / Searchable.md
Last active Aug 15, 2018
TNT Searchable Trait
View Searchable.md
<?php

use Illuminate\Database\Eloquent\Model;
use TeamTNT\TNTSearch\Facades\TNTSearch;

trait Searchable
{
    /**
     * Auto update search index using model events.
View DockerCompose.md
version: '2'

services:
  # Source
  source:
    image: tianon/true
    container_name: nomdedoseuappaqui-source
    volumes:
      - ./:/var/www
View example.md
// Primeira forma, essa e a mais xerosa
$produto->decrement('quantidade', 3); // isso vai subtrair 3 da quantidade do produto no model

// Segunda forma, nao muito xerosa, mas funciona
$produto->quantidade = $produto->quantidade - 3;
$produto->save();
@flyingluscas
flyingluscas / UsingFakerInPT-BR.md
Last active Nov 12, 2019
Utilizando Faker em pt-BR
View UsingFakerInPT-BR.md

Utilizando Faker em pt-BR

Acesse o seu arquivo app/Providers/AppServiceProvider.php, e no método register adicione o seguinte :

/**
 * Register any application services.
 *
 * @return void
 */
@flyingluscas
flyingluscas / RelationshipsOnSeeder.md
Last active Oct 28, 2016
Laravel - Example of relationships on seeders
View RelationshipsOnSeeder.md
use Illuminate\Database\Seeder;

class ClientTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
@flyingluscas
flyingluscas / MyUbuntuThemeConfigurations.md
Last active Feb 26, 2019
My Ubuntu Theme Configurations
View MyUbuntuThemeConfigurations.md

My Ubuntu Theme Settings

Install Theme

$ sudo add-apt-repository ppa:noobslab/themes
$ sudo apt-get update
$ sudo apt-get install flatabulous-theme

Install Icons Pack

View estados-cidades.json
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
View example.md
$text = '10,15,20,25,30,22,14,33';

$sets = array_map(function ($values) {
    return sprintf('/(%s)/', implode('|', $values));
}, [
    range(10, 15),
    range(20, 25),
    range(30, 35),
]);
View example.md
$users = factory(App\User::class, mt_rand(2, 10))->create();

factory(App\Order:class, mt_rand(2, 10))->make()->each(function ($order) use ($users) {
    $order->user()->associate($users->random())->save();
});
You can’t perform that action at this time.