Skip to content

Instantly share code, notes, and snippets.

@dimarti
dimarti / php-pools.md
Created May 31, 2022 09:16 — forked from holmberd/php-pools.md
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
@dimarti
dimarti / Laravel-Container.md
Created March 14, 2022 10:56
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@dimarti
dimarti / prestashop-nginx.conf
Created November 6, 2019 07:42 — forked from victoraguilarc/prestashop-nginx.conf
NGINX Configuration for Prestashop 1.7.3, its works fully
server {
charset utf-8;
#listen <YOUR_IP>:80;
server_name <YOUR_DOMAIN> www.<YOUR_DOMAIN>;
root /PATH/TO/YOUR/PRESTASHOP/INSTALLATION;
index index.php;
access_log /var/log/nginx/domains/<YOUT_DOMAIN>.log combined;
@dimarti
dimarti / index.html
Created November 5, 2019 11:00
Basic HTML5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<link rel="stylesheet" href="css/main.css" />
@dimarti
dimarti / sources.list
Created October 8, 2019 06:00
Mi repositorios Debian testing (Stretch) Septiembre 2016
Este es el contenido de mi /etc/apt/sources.list
########### DEBIAN TESTING REPOS #############
## Seguridad testing
deb http://security.debian.org/ testing/updates main contrib non-free
#deb-src http://security.debian.org/ testing/updates main contrib non-free
## Oficiales testing
deb http://ftp.fr.debian.org/debian/ testing main contrib non-free
@dimarti
dimarti / sampleREADME.md
Created April 11, 2019 11:43 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@dimarti
dimarti / README-Template.md
Created April 11, 2019 11:43 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs
sudo npm install -g cordova
sudo npm install -g ionic
.loader {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: #fff;
opacity: .8;
z-index: 1;
}
@dimarti
dimarti / example.php
Created April 2, 2018 10:13
Eloquent from Query Builder
$query = DB::table('seasons')
->select('seasons.*')
->join('season_user', 'season_user.season_id', '=', 'seasons.id')
->where('seasons.closed', 1)
->where('season_user.user_id', Auth::user()->id)
->where('season_user.begin', '<=', date('Y-m-d'))
->where(function($query){
$query->whereNull('season_user.end')
->orWhere('season_user.end', '>=', date('Y-m-d'));
})