Skip to content

Instantly share code, notes, and snippets.

View nelson6e65's full-sized avatar
:atom:
Creating software

Nelson Martell nelson6e65

:atom:
Creating software
View GitHub Profile
@nelson6e65
nelson6e65 / readme.md
Last active November 4, 2022 20:24
PHPStan examples

PHPStan examples

Types

Using string-class<T> generic typehint with static as T

You can use static in generic to refer to the current class. This is useful in trait implementations:

@nelson6e65
nelson6e65 / README.md
Last active April 27, 2021 01:38
Install gRPC PHP
@askuri
askuri / README.md
Last active January 4, 2023 08:57 — forked from martianatwork/README.md

I'm sorry for the code quality, got this working in 1 night work.

anyways, this is currently working fine ignore error related to should be object or Could not resolve reference it will be fixed in future

requires cebe/php-openapi package composer req cebe/php-openapi

@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.

I'm sorry for the code quality, got this working in 1 night work.

anyways, this is currently working fine ignore error related to should be object or Could not resolve reference it will be fixed in future

requires cebe/php-openapi package composer req cebe/php-openapi

@nelson6e65
nelson6e65 / phpcs.xml
Last active November 4, 2022 20:23
PHP CodeSniffer config for Laravel
<?xml version="1.0" encoding="UTF-8" ?>
<ruleset name="Default">
<description>Coding standard configuration.</description>
<rule ref="PSR12" />
<rule ref="PEAR.Functions.ValidDefaultValue" />
<rule ref="PEAR.Commenting.InlineComment" />
<rule ref="Squiz.Operators.ValidLogicalOperators" />
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="50" />
@torian257x
torian257x / app.blade.php
Last active April 26, 2021 07:29
multi build of laravel mix with performance improvement for tailwindcss "yarn hot" -> javascript as hot, tailwind as watch
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
@zobayer1
zobayer1 / fedora_post_install.md
Last active July 31, 2024 20:09
Fedora 36 post installation notes for software developers. Things you should do after installing your new Fedora 36 workstation.

Fedora 36 Post Installation (For Software Developers)

Top N things you should do after installing or upgrading to your new Fedora 36 workstation.


Settings

Change Hostname

@renearias
renearias / android_sha1.md
Last active June 25, 2020 04:05
Pidelo Hacks

Sha1

Comando para consultar Clave Sha1 para probar Auth de Firebase

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@julienbourdeau
julienbourdeau / webpack.mix.js
Created April 20, 2020 06:43
Laravel Mix with multiple Tailwind config and PurgeCSS (separate Admin dashboard and Front app)
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const rootPath = Mix.paths.root.bind(Mix.paths);
const tailwindPlugins = function(configFile, paths) {
const pluginList = [tailwindcss(configFile)];
if (mix.inProduction()) {
pluginList.push(require('@fullhuman/postcss-purgecss')({