Skip to content

Instantly share code, notes, and snippets.

@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
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
@application2000
application2000 / regex_from_object_to_array_accessing.txt
Created January 30, 2017 12:15
PhpStorm regex to replace PHP object-like accessing to PHP array-like accessing
Do you keep modifiying $my_variable->foo to $my_variable['foo'] over and over everyday? This regex is for you.
text to replace : (\$some_variable)(\->)([\w]+)
replacement : $1\[\'$3\'\]
Backup your files to prevent any problems. Use this with caution. At your own risk.
Usage:
1. Keyboard shortcut Cmd + R or equivalent to trigger a text replace
2. Click on the regex checkbox
@gwillem
gwillem / magento-nginx.conf
Last active July 29, 2023 10:13
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@Jakobud
Jakobud / bootstrap-ms.scss
Last active June 15, 2022 12:42 — forked from andyl/bootstrap_ms.css.scss
Adds in the missing 480px-797px breakpoint range to Bootstrap 3 for SASS
// Bootstrap Mid-Small - col-ms-* - the missing grid set for Bootstrap3.
//
// This is a hack to fill the gap between 480 and 767 pixels - a missing range
// in the bootstrap responsive grid structure. Use these classes to style pages
// on cellphones when they transition from portrait to landscape.
//
// Contains:
// Columns, Offsets, Pushes, Pulls for the Mid-Small layout
// Visibility classes for the Mid-Small layout
// Redefined visibility classes for the Extra Small layout
@clayzermk1
clayzermk1 / README.md
Created August 10, 2012 19:54
jQuery / Twitter Bootstrap List Tree Plugin

jQuery / Twitter Bootstrap List Tree Plugin

Demo: http://jsfiddle.net/clayzermk1/QD8Hs/

Overview

I needed a simple plugin to build a two-tier collapsible list with checkboxes. I wanted it to fit well with Twitter's Bootstrap. I couldn't find one that was simple enough. I hope you enjoy =) Feel free to send feedback.