Skip to content

Instantly share code, notes, and snippets.

@locopine
locopine / ext.txt
Created December 17, 2023 02:23 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@locopine
locopine / UsingFakerInPT-BR.md
Created July 25, 2023 17:03 — forked from flyingluscas/UsingFakerInPT-BR.md
Utilizando Faker em pt-BR

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
 */
@locopine
locopine / Dockerfile
Created February 28, 2023 22:08 — forked from evansims/Dockerfile
Dockerfile: php-fpm 7.4-fpm alpine w/ gd bz2 intl mbstring redis mongodb xdebug opcache
FROM php:7.4-fpm-alpine
WORKDIR "/application"
# Install essential build tools
RUN apk add --no-cache \
git \
yarn \
autoconf \
g++ \
make \
@locopine
locopine / simple_mta.md
Created February 25, 2023 15:29 — forked from n3dst4/simple_mta.md
Using Postfix as an MTA so that local mail on a linux box gets delivered to somewhere useful

Simple Postfix MTA Setup for headless hobbyists

So, you're a hobbyist or maybe even a user in a small-scale business capacity and you have some kind of headless Linux (or other *nix) box, maybe it's a VPS or a Raspberry Pi, and you want it to be able to email you with alerts (setting up monitoring is a separate subject!)

History

I went round in circles with this for a while, because it seemed like such a

@locopine
locopine / php-redis-custom-flags.sh
Created January 27, 2023 15:05 — forked from mingalevme/php-redis-custom-flags.sh
Installing PHP Redis extension inside PHP-Alpine-based Docker container
NPROC=$(getconf _NPROCESSORS_ONLN)
mkdir -p /usr/src/php/ext
cd /usr/src/php/ext
pecl bundle redis
docker-php-ext-configure redis --enable-redis-igbinary --enable-redis-lzf
docker-php-ext-install -j${NPROC} redis
cd -
@locopine
locopine / drop-table
Created January 12, 2023 23:50 — forked from sohelamin/drop-table
Laravel drop tables via artisan command
php artisan tinker
$tables = DB::select('SHOW TABLES');
$tables_in_database = "Tables_in_".Config::get('database.connections.mysql.database');
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
foreach ($tables as $table) {
Schema::drop($table->$tables_in_database);
}
@locopine
locopine / recommended-settings.json
Created November 9, 2022 19:47 — forked from DoctorDerek/recommended-settings.json
Recommended settings.json file for new web developers setting up VS Code according to https://medium.com/p/65aaa5788c0d/ by Dr. Derek Austin 🥳
@locopine
locopine / DashboardController.php
Created September 17, 2022 12:21 — forked from Loupeznik/DashboardController.php
Laravel Visitor Counter - data visualization
// app/Http/Controllers/DashboardController.php
<?php
namespace App\Http\Controllers;
use App\Models\Visitor;
use Illuminate\Support\Facades\DB;
class DashboardController extends Controller
{
# Para um novo projeto, crie esta estrutura
[dev-user1] $ mkdir projeto
[dev-user1] $ cd projeto
[dev-user1] $ git init
[dev-user1] $ touch README
[dev-user1] $ git add .
[dev-user1] $ git commit -am "Initial commit"
# Crie no servidor um repositório do tipo bare para "guardar" os commits
[bare-server1] $ mkdir -p /git/projeto