Skip to content

Instantly share code, notes, and snippets.

View AndresReyesDev's full-sized avatar
🥣
Cooking the Internet Soup since 1999…

Andrés Reyes Galgani AndresReyesDev

🥣
Cooking the Internet Soup since 1999…
View GitHub Profile
@benpoorker
benpoorker / gist:39f5a9acbbb2882778ace0ef93cabb4b
Created April 10, 2024 20:12
Fix Laravel Valet favicon 404
https://github.com/laravel/valet/issues/375#issuecomment-629801919
Nginx is looking for a favicon.ico file at the root level.
Instead, for Laravel projects, it should look in the public folder.
Just add /public on the files paths inside your config file, and run valet restart:
location = /public/favicon.ico { access_log off; log_not_found off; }
location = /public/robots.txt { access_log off; log_not_found off; }
@ahmadshuami
ahmadshuami / Laravel Application (<laravel 9.19)
Last active February 2, 2023 08:12
How to create a simple laravel application (using bootstrap 5)
- Install Apache / Nginx
- Install PHP
- Install Composer
- on Windows, download the installer and install (https://getcomposer.org/download/)
- on macOS, you can install using brew
- on macOS, make sure to place Composer's system-wide vendor bin directory in your $PATH
$ echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.zshrc
@arafathusayn
arafathusayn / removing_script.js
Last active July 24, 2024 06:38
Remove Tawk.to Branding (2022)
var removeBranding = function() {
try {
var element = document.querySelector("iframe[title*=chat]:nth-child(2)").contentDocument.querySelector(`a[class*=tawk-branding]`)
if (element) {
element.remove()
}
} catch (e) {}
}
@joshuatf
joshuatf / disable-woocommerce-admin.php
Created March 11, 2020 09:44
A plugin to disable the new WooCommerce Admin package in WooCommerce
<?php
/**
* Plugin Name: Disable WooCommerce Admin
* Description: This plugin disables the new WooCommerce Admin package in WooCommerce.
* Version: 1.0
*/
add_filter( 'woocommerce_admin_disabled', '__return_true' );
@AndresReyesDev
AndresReyesDev / FocusAppQuotesEspañol.txt
Created January 7, 2020 19:24
Frases para procastinadores en español recopiladas de la web. Puedes importarlas directamente a Focus App de Mac. Sientanse libres de agregar más como comentario a este hilo y las agregaré al documento. ¡Saludo colegas procastinadores!
La procrastinación es como una tarjeta de crédito: es muy divertida hasta que te llega el estado de cuenta -Christopher Parker
Cuando tienes que escalar una montaña, no pienses que esperando se hará más pequeña -Vox Populi
No te pongas a contemplar toda la escalera, simplemente da el primer paso -Martin Luther King
Si pospones las cosas hasta que estés seguro de que están bien, entonces nunca lograrás hacer nada -Norman Vincent Peale
El perfeccionismo es la madre de la procrastinación -Michael Hyatt
Si no fuera por el último minuto, nada se haría -Rita Mae Brown
La procrastinación es el Arte de mantenerse al día con las cosas de ayer -Don Marquis
La mayor debilidad de un erudito es: llamar investigación a la procrastinación -Stephen King
La procrastinación es una de las más comunes y mortales enfermedades, y el pago de su cuota en cuanto a éxito y felicidad es carísimo -Wayne Gretzky
¿Sabes lo que sucede cuando le das una buena idea a un procrastinador?… Nada, no sucede nada -Anónimo
yum install epel-release -y
yum install jpegoptim -y
yum install optipng -y
for i in `ls --hide='system' /var/cpanel/users/`; do
find /home/$i/ -type f -iname '*.jpg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.jpeg' -print0 | xargs -0 -n4 -P5 sudo -H -u $i jpegoptim -s
find /home/$i/ -type f -iname '*.png' -print0 | xargs -0 -n4 -P5 sudo -H -u $i optipng -o1 -strip all
sleep 5
@timwco
timwco / delete.md
Last active July 20, 2023 15:59
LinkedIn: Delete Messages (June 2022)

What

LinkedIn is a valuable resource, but sometimes it sucks. One of those times is when you want to delete messages. You have to select each message one by one. It takes about 4 "clicks" to successfully delete a message.

This script should help. Since LI requires you to perform multiple steps, I decided to automate it for you. Once you initiate the script, it will run every second. If a message has the ability to be deleted, it will be. If not, it will be archived. Some "InMail" messages cannot be deleted on the web app. This script should work as long as LI doesn't change their page layout or element names, which happens often.

Last tested & verified working on: June, 10, 2022

Special Thanks to @noncent for the updated script.

@AndresReyesDev
AndresReyesDev / 2022_01_01_000001_create_regions_table.php
Last active April 13, 2024 12:54
Laravel 8 y Laravel 9 — División Administrativa de Chile: Regiones, Provincias y Comunas. Migraciones y Seeders.
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRegionsTable extends Migration
{
/**
* Run the migrations.
<IfModule mod_rewrite.c>
# Turn Off mod_dir Redirect For Existing Directories
DirectorySlash Off
# Rewrite For Public Folder
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
@gdespirito
gdespirito / ChileanTableSeeder.php
Created September 17, 2018 03:16
Table Seeder para cargar regiones y comunas de chile en Laravel (2018). Incluyendo nueva Región de Ñuble.
<?php
use Illuminate\Database\Seeder;
class ChileTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void