Skip to content

Instantly share code, notes, and snippets.

View laymont's full-sized avatar
🎯
Este dia sere mejor que ayer!

Laymont Arratia laymont

🎯
Este dia sere mejor que ayer!
View GitHub Profile
@laymont
laymont / HasFormattedDatesTrait.php
Created July 13, 2024 19:25
trait fommatter dates laravel
<?php
namespace App\Traits;
use Carbon\Carbon;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Casts\Attribute;
trait HasFormattedDatesTrait
{
@laymont
laymont / HandlesPerPageTrait.php
Created July 13, 2024 19:24
Set default pagination laravel
<?php
namespace App\Traits;
use Illuminate\Http\Request;
trait HandlesPerPageTrait
{
/**
* Get the per page value from the request.
@laymont
laymont / pint.json
Created June 29, 2024 19:04
Pint es una herramienta de formateo de código PHP que se basa en el paquete laravel/pint
{
"preset": "laravel",
"exclude": [
"vendor"
]
}
@laymont
laymont / .phpcs.xml.dist
Created June 29, 2024 19:03
PHP_CodeSniffer es una herramienta que verifica si tu código cumple con ciertos estándares de codificación
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<description>The Laravel Coding Standards</description>
<rule ref="PSR12" />
<exclude-pattern>*/database/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>
@laymont
laymont / .php-cs-fixer.dist.php
Created June 29, 2024 19:03
PHP-CS-Fixer es una herramienta que corrige automáticamente los problemas de formato y estilo en tu código PHP
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/app',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/resources',
__DIR__ . '/routes',
__DIR__ . '/tests',
@laymont
laymont / tlint.json
Created June 29, 2024 19:02
Tlint es una herramienta de linting (análisis estático) para archivos TypeScript.
{
"rules": {
"no-unused-vars": true,
"no-undef": true,
"no-redeclare": true,
"no-unreachable": true,
"no-console": true,
"no-debugger": true
},
"ignore": [
@laymont
laymont / Pagination.vue
Created December 15, 2022 15:49
Pagination Inertia vue3
<script setup>
import {Inertia} from "@inertiajs/inertia";
import {Link} from "@inertiajs/inertia-vue3";
const props = defineProps({
links: {
type: Object,
default: () => ({})
}
})
@laymont
laymont / countries.json
Created December 4, 2022 21:12 — forked from Yizack/countries.json
List of countries with continent and capital in english and spanish, the list also includes phone, country codes and domain tld in JSON. Lista de países con continente y capital en inglés y español con código de teléfono, código de país y dominio, en JSON. Updated 2022
{
"countries" : [
{
"name_en": "Afghanistan",
"name_es": "Afganistán",
"continent_en": "Africa",
"continent_es": "África",
"capital_en": "Kabul",
"capital_es": "Kabul",
"dial_code": "+93",
@laymont
laymont / boot_model_laravel
Created November 23, 2022 22:20
Edit boot model laravel
public static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->nombre = strtoupper($model->nombre);
});
}
@laymont
laymont / deterner_jekyll.md
Last active November 23, 2022 14:29
Detener Jekyll server

Para detener Jekyll server cuando por alguna razon no se detiene:

$ lsof -wni tcp:4000
$ kill -9 <PID of process>

La proxima vez que use el comando bundle exec jekyll server asegurese de detenerlo con la combinación de teclas Ctrl+C

Update