Skip to content

Instantly share code, notes, and snippets.

View bayareawebpro's full-sized avatar
✔️
Available for Consulting

Dan Alvidrez bayareawebpro

✔️
Available for Consulting
View GitHub Profile
@dac514
dac514 / EventEmitter.php
Last active November 4, 2022 19:52
Refactor Your Slow Form Using PHP Generators and Event Streams
<?php
/**
* @license GPLv3 (or any later version)
* @see http://kizu514.com/blog/refactor-your-slow-form-using-php-generators-and-event-streams/
*/
namespace KIZU514;
class EventEmitter
{
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC
@ankurk91
ankurk91 / laravel_horizon.md
Last active April 21, 2024 01:27
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 20/22 server

Laravel 8+, Horizon 5.x, Redis 6+

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now; it should show status as inactive on horizon dashbaord

Install redis-server

@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@vielhuber
vielhuber / 0_README.MD
Last active August 24, 2023 08:39
google maps colorize embed without needed maps key and black and white with pure #css

#1

  • recommended current example (extracted from the official embed function)
<?php
$zoom = 5000;
$address = 'Auenstraße 6, 80469 München';
//$address = '48.127660,11.575380'; // lat/lng is also possible but without an address card
$lng = 'de';
<?php
namespace App;
use Closure;
class CommandEventsListener
{
protected $startCallbacks = [];
protected $finishCallbacks = [];
@giansalex
giansalex / docker-php-ext-install.md
Last active October 3, 2023 10:02
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@jeffochoa
jeffochoa / Response.php
Last active April 20, 2024 12:35
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@addyosmani
addyosmani / workbox.md
Last active January 20, 2024 16:14
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@gocanto
gocanto / .travis.yml
Last active September 29, 2018 08:06
MySQL 5.7 Travis CI configuration
language: php
php:
- 7.0
- 7.1
services:
- mysql
addons: