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
@dkorobtsov
dkorobtsov / Add_WindowsDefender_Exclusions.ps1
Last active April 24, 2024 08:22
PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
# PowerShell script to add Windows Defender exclusions for WSL2 and JetBrains IDE performance issues
#
# For context please read this thread:
# https://github.com/microsoft/WSL/issues/8995
#
# How to use?
# - Save the Script: Open a text editor like Notepad and paste the PowerShell script into it.
# - Save the file with a .ps1 extension, for example, Add_WindowsDefender_Exclusions.ps1.
# - Run PowerShell as Administrator: Search for "PowerShell" in the Start menu, right-click on it, and choose "Run as administrator".
# - Navigate to the Script's Location: Use the cd command to navigate to the directory where you saved the .ps1 file.
@Atinux
Atinux / sse.ts
Last active April 22, 2024 20:39
SSE endpoint example with Nuxt 3
// ~/server/api/sse.ts
export default defineEventHandler(async (event) => {
if (!process.dev) return { disabled: true }
// Enable SSE endpoint
setHeader(event, 'cache-control', 'no-cache')
setHeader(event, 'connection', 'keep-alive')
setHeader(event, 'content-type', 'text/event-stream')
setResponseStatus(event, 200)
@jpcaparas
jpcaparas / nginx.conf
Last active October 16, 2023 14:11
Make a node application work with PM2 & Laravel Forge
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/<your-site>/before/*;
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active May 2, 2024 16:22
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@ciamarro
ciamarro / livewire-directive.md
Created March 18, 2020 13:15
@livewire directive for phpstorm
  1. File > Settings > Languages & Frameworks > PHP > Blade
  2. Uncheck use default settings
  3. Directives > +
  4. Name livewire
  5. Prefix <?php '', [
  6. Suffix ])?&gt;

Converting Tailwind UI Alpine transitions to Vue transitions

After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.

Things to be aware of:

  • Alpine calls the beginning and ending states "start" & "end"
  • Vue calls the beginning and ending states "from" and "to"
  • Alpine has inline "directives" ie x-transition:enter="classes"
  • Vue has a wrapper component that applies classes to the child
  • Alpine applies the classes you pass it for each state, :enter-start="class"
@meigwilym
meigwilym / index.md
Created November 28, 2019 08:52
Notes on stitcher.io's Laravel beyond CRUD

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

@blackfyre
blackfyre / GeneralModal.vue
Last active November 14, 2023 04:45
Modals in Laravel Nova Tools
<template>
<modal @modal-close="handleClose">
<form
@submit.prevent="handleConfirm"
slot-scope="props"
class="bg-white rounded-lg shadow-lg overflow-hidden"
style="width: 460px"
>
<slot :uppercaseMode="uppercaseMode" :mode="mode">
<div class="p-8">
@Krato
Krato / Laravel Nova snippets.md
Last active November 25, 2020 23:02
A set of snippets I use in Laravel Nova

A set of snippets I use in Laravel Nova

Snippets

Vue,js devtools (Only with manual installation)

cd ./nova 
yarn
mv webpack.mix.js.dist webpack.mix.js
@ricardoaugusto
ricardoaugusto / customize-laravel-notification-email.md
Last active October 16, 2019 20:16
Customize Laravel 5.6 notification email
  1. Run php artisan make:notification MyResetPassword to create a Notification Class MyResetPassword at app/Notifications
  2. add use App\Notifications\MyResetPassword; to the User model
  3. Add this method to User model:
public function sendPasswordResetNotification($token)
{
    $this->notify(new MyResetPassword($token));
}