Skip to content

Instantly share code, notes, and snippets.

@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
@vNNi
vNNi / commit-mensagens-semânticas.md
Created February 1, 2020 17:03
Guia rápido de commits com mensagens semânticas em português

Commits de Mensagens Semânticas

Veja como uma pequena diferença em seus commits podem te tornar um programador melhor.

Formato: <tipo>(<escopo>): <mensagem>

<escopo> é opcional (Esse é mais usado em contextos de mono-repositórios)

Exemplo

@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()
{
@misdreavus79
misdreavus79 / Laravel PHP7 LEMP Google Cloud.md
Last active July 22, 2018 10:21 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 17.x, PHP 7.x, Nginx 1.9.x

Steps to install latest Laravel, LEMP on Google Cloud Ubuntu 17.04 version.

Fork of https://gist.github.com/santoshachari/87bf77baeb45a65eb83b553aceb135a3

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@nikhita
nikhita / update-golang.md
Last active June 28, 2024 03:14
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@nfarina
nfarina / mock-storage.js
Last active November 23, 2023 15:50
Mock Google Cloud Storage for JS
//
// Quick & Dirty Google Cloud Storage emulator for tests. Requires
// `stream-buffers` from npm. Use it like this:
//
// `new MockStorage().bucket('my-bucket').file('my_file').createWriteStream()`
//
class MockStorage {
buckets: {[name: string]: MockBucket};
@davidwilliamdacosta
davidwilliamdacosta / exibir-produtos-sem-estoque-final-pagina.php
Created December 7, 2016 13:10
Exibir produtos sem estoque final da pagina Woocommerce
<?php
/**
* Order product collections by stock status, instock products first.
*/
class iWC_Orderby_Stock_Status
{
public function __construct()
{
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
#!/bin/bash
homestead up
homestead ssh
apt-get update
#Additional Packages
apt-get install -y zsh
@vluzrmos
vluzrmos / compat_l5.php
Last active November 1, 2022 20:43
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)