Skip to content

Instantly share code, notes, and snippets.


Sidrit Trandafili sidis405

View GitHub Profile
sidis405 /
Created May 25, 2020 — forked from holmberd/
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
View BindDatabaseServiceProvider.php
namespace App\Commands\Database;
use Illuminate\Support\ServiceProvider;
class BindDatabaseServiceProvider extends ServiceProvider
public function boot()
View gist:688185b24823bba134aaa395a99c721e
server {
listen 80;
server_name HOST_NAME;
root "/var/www/HOST_NAME/current/public";
index index.php index.html index.htm;
access_log off;
error_log /var/log/nginx/HOST_NAME.error.log crit;
View script.js_for_bjorn
* Tab enabling/disabling. Place this at the end of scripts.js
* You'll be good to go.
* Sid
$( function() {
if(window.location.hash) {
$('*[data-isotope-filter="'+ decodeURIComponent(window.location.hash.substring(1)) + '"]').trigger('click');
sidis405 / EloquentFooRepository.php
Created Dec 20, 2016 — forked from thepsion5/EloquentFooRepository.php
Example implementation of a Eloquent-based repository that provides a fluent interface for sorting and pagination without exposing the underlying model API.
View EloquentFooRepository.php
class EloquenFooRepository
* The base eloquent model
* @var Eloquent
protected $model;
sidis405 / gulpfile.js
Created Oct 30, 2015
Using Elixir outside of Laravel
View gulpfile.js
var elixir = require('laravel-elixir');
config.assetsPath = 'app';
config.publicPath = 'dist';
elixir(function(mix) {
// your mixes here
View singularize.php
* Singularize a string.
* Converts a word to english singular form.
* Usage example:
* {singularize "people"} # person
function singularize ($params)