Skip to content

Instantly share code, notes, and snippets.

View henryavila's full-sized avatar
💭
Knowledge is power

Henry Ávila henryavila

💭
Knowledge is power
View GitHub Profile
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active July 4, 2024 17:31
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@JeffreyWay
JeffreyWay / .bash_profile
Created May 8, 2013 18:02
Laravel aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@danb-humaan
danb-humaan / UuidModel.php
Created December 3, 2015 10:07
Trait for implementing UUIDs in Laravel models
<?php
namespace App\Traits;
use Rhumsaa\Uuid\Uuid;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Trait UuidModel
* @package App\Traits
@cvan
cvan / HOWTO.md
Last active May 31, 2024 14:19
get all URLs of all network requests made on a web page from the Chrome Dev Tools (from an exported HAR)

Setup

Using Homebrew on Mac OS X:

brew install jq

Add these aliases to your profile (e.g., ~/.zshrc, ~/.bashrc, ~/.profile, etc.):

alias hurlp='pbpaste | jq ".log.entries" | tee >(jq --raw-output "[.[] | .request.url] | sort | unique | .[]")'

alias hurld='pbpaste | jq ".log.entries" | jq --raw-output "[.[] | .request.url] | sort | unique | .[]" | harurls | tee >(xargs -n 1 curl -O $1)'

@rafael-neri
rafael-neri / validar_cpf.php
Last active June 27, 2024 01:43
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@dannygsmith
dannygsmith / valet-plus-destroy
Last active July 18, 2023 09:07
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@JordanDalton
JordanDalton / Employee.php
Created September 23, 2017 21:29
Here's an example of what do to if you desire to use Laravel's updateExistingPivot() while getting your attributes mutated through a pivot model.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Employee extends Model
{
/**
@joaorobertopb
joaorobertopb / .php_cs.dist
Last active December 17, 2022 15:37
Esse é um exemplo de configuração do php-cs-fixer que foi construído usando a predefinição Laravel do StyleCI.
<?php
$header = <<<'EOF'
Esse arquivo faz parte de <Empresa/Projeto>
(c) Nome Autor <e-mail>
Lorem ipsum ...
EOF;
@Danga1963
Danga1963 / WRP IPTV.m3u
Last active June 24, 2024 20:28
WRP IPTV.m3u
#EXTM3U
#EXTINF:-1 tvg-id="" tvg-name="BigBrotherBrasil 2018" tvg-logo="http://bbb2018.net/wp-content/uploads/2017/08/bbb-2018.png" group-title="VARIEDADES",BigBrotherBrasil 2018
http://painel.iptvmove.com:25461/live/danga07/1963/1116.m3u8
#EXTINF:-1 tvg-id="" tvg-name="BigBrotherBrasil 2018 [Alter]" tvg-logo="http://bbb2018.net/wp-content/uploads/2017/08/bbb-2018.png" group-title="VARIEDADES",BigBrotherBrasil 2018 [Alter]
http://painel.iptvmove.com:25461/live/danga07/1963/3128.m3u8
#EXTINF:-1 tvg-id="A&E [Brazil]" tvg-name="A&E" tvg-logo="http://i.imgur.com/7NKeRuh.png" group-title="DOCUMENTARIOS",A&E
http://painel.iptvmove.com:25461/live/danga07/1963/1354.m3u8
#EXTINF:-1 tvg-id="" tvg-name="ALL Sports HD" tvg-logo="https://i0.wp.com/www.simpletvbrasil.tv/cliente/logo/4366c67d4d4be3381abe034e7c15b80e.png" group-title="CANAIS ESPORTE",ALL Sports HD
http://painel.iptvmove.com:25461/live/danga07/1963/1215.m3u8
#EXTINF:-1 tvg-id="" tvg-name="AMC" tvg-logo="http://i.imgur.com/JYislkb.png" group-title="FILMES/SERI