Skip to content

Instantly share code, notes, and snippets.

View wkhayrattee's full-sized avatar

Wasseem Khayrattee wkhayrattee

View GitHub Profile
@ThijsFeryn
ThijsFeryn / varnish.service
Created May 13, 2020 12:01
varnish systemd service
[Unit]
Description=Varnish Cache Plus, a high-performance HTTP accelerator
After=network-online.target
[Service]
Type=forking
KillMode=process
# Maximum number of open files (for ulimit -n)
LimitNOFILE=131072
@danielbachhuber
danielbachhuber / thrasher-v2.php
Created June 5, 2017 18:14
Thrash APCu until it can no longer allocate memory
<?php
/**
* Thrash APCu until it can no longer allocate memory
*/
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
@vwasteels
vwasteels / getMenuHierarchically.md
Last active June 28, 2022 13:12
Retrieve menu items hierarchically in Wordpress
/**
 * Get Menu Items From Location
 *
 * @param $location : location slug given as key in register_nav_menus
 */

function getMenuItemsFromLocation($location) {
	$theme_locations = get_nav_menu_locations();
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048