Skip to content

Instantly share code, notes, and snippets.

View antyblin's full-sized avatar
🦝

Pavel antyblin

🦝
  • Saint-Petersburg
View GitHub Profile
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
wget https://xdebug.org/files/xdebug-2.5.5.tgz
tar xvzf xdebug-2.5.5.tgz
cd xdebug-2.5.5
phpize
@carboneater
carboneater / nginx-ssl-failure.conf
Created April 28, 2017 21:00
Fail2ban filter to detect SSL Handshake Failure due to a bad client SSL Version
# fail2ban filter configuration for nginx
# Detects SSL Handshake Failures
[Definition]
failregex = \[crit\] \d+\#\d+: \*\d+ SSL_do_handshake\(\) failed \(SSL: error:1417D18C:SSL routines:tls_process_client_hello:version too low\) while SSL handshaking, client: <HOST>, server: \S*\s*$
ignoreregex =
@ariefhikam
ariefhikam / index.php
Last active August 6, 2019 12:25
Laravel Sorting from another table with Eloquent
/*
By: Arief Hikam
Laravel Sorting from another table with Eloquent
Sometimes it is difficult to perform sorting by Eloquent because relationships do not use the JOIN in query builder but use
Eager Load which mean we can not sorting by another table field because the field is doesn't exist.
This is how we use the simple code Eloquent and sorting another table by using LEFT JOIN.
I think this is the simplest way I can think of.
@nasrulhazim
nasrulhazim / readme.md
Last active September 3, 2018 04:45
Using Middleware to Check Account Activation and Resend Activation E-mail
@nasrulhazim
nasrulhazim / readme.md
Last active September 3, 2018 04:54
Enable Account Activation in Order to Login to the System.
@nasrulhazim
nasrulhazim / readme.md
Last active June 2, 2021 19:42
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@mass6
mass6 / 01.FiniteStateMachine.README.md
Last active August 29, 2017 10:19
Laravel 5.3 Finite State Machine Trait
@thejettdurham
thejettdurham / homestead-xdebug.md
Last active November 1, 2021 23:43
Debugging laravel/lumen + artisan from Homestead with PHPStorm over xdebug

This config works for me with the following setup, YMMV

  • OSX El Capitain
  • PHPStorm 2016.2.1
  • Lumen 5.2
  • Homestead as of Lumen 5.2
    • php 7.0.8-2
    • Xdebug 2.4.0

Homestead Configuration

@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@tom--
tom-- / Random bytes, ints, UUIDs in PHP.md
Last active February 11, 2023 06:14
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )