Skip to content

Instantly share code, notes, and snippets.

View markoheijnen's full-sized avatar

Marko Heijnen markoheijnen

View GitHub Profile
@lennartvdd
lennartvdd / ubuntu-lemp-yii1-installer.sh
Last active January 16, 2018 06:04
Ubuntu LEMP installer (Yii 1.x)
#!/bin/bash
# This script does the following things
# - update apt respositories
# - Install:
# - nginx
# - memcaced
# - php5-fpm
# - php5-mysql
# - php5-curl
@bastosmichael
bastosmichael / gist:5376293
Last active December 16, 2015 04:19
Blocking WordPress Botnet for Nginx Configurations
location / {
try_files $uri $uri/ /index.php?$args;
# block WP Botnet workstations
deny 31.184.238.38;
deny 178.151.216.53;
deny 91.224.160.143;
deny 195.128.126.6;
deny 85.114.133.118;
deny 177.125.184.8;
deny 89.233.216.203;
@Viper007Bond
Viper007Bond / whatissoslow.php
Last active October 29, 2023 14:23
WordPress: Times how long it takes each filter and action to run and displays results at the end of the page. Quick and dirty.
<?php
/**
* This little class records how long it takes each WordPress action or filter
* to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
@brichards
brichards / sb-github-downloads.php
Last active February 16, 2021 17:10
StartBox GitHub Download Generator
<?php
/**
* Plugin Name: StartBox GitHub .zip Generator
* Description: Generates a .zip download for StartBox from GitHub Master.
*
* @props Konstantin Kovshenin (@kovshenin) for sharing his work used on underscores.me (http://code.svn.wordpress.org/underscoresme/plugins/underscoresme-generator/underscoresme-generator.php)
*/
class SB_Download_Generator {
@joncave
joncave / endpoints.php
Created June 7, 2012 19:41
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
@nacin
nacin / gist:2323060
Created April 6, 2012 21:23
Nacin's SVN override
# SVN override to prevent commits that try to implicitly commit more than one file.
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci,
# which usually results in me writing longer and more helpful commit messages.
# Also, it prevents me from committing unrelated code, so there's that.
#
# Also checks for error_log, var_dump, and console.log, and rejects these commits.
function svn() {
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then
svn stat --ignore-externals | grep '^[^?X]'