View EncryptCookies.php
<?php namespace App\Http\Middleware;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Cookie\Middleware\EncryptCookies as BaseMiddleware;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
// The first two functions are identical to the originals in the parent class
// other than the sections marked "MOD". The third function is a new helper
View cf7-campaignmonitor.php
Plugin Name: Contact Form 7 - Campaign Monitor Addon
Plugin URI:
Description: Add the power of CampaignMonitor to Contact Form 7
Author: Joshua Bettigole
Author URI:
Version: 1.06 (Modified)
View amfe.php
Plugin Name: Add more files extensions
Plugin URI:
Description: Add more files extensions with a new field in your <a href="options-media.php">Media Settings</a>.
Version: 0.2
Author: Arthur Lacoste
Author URI:
# This is a script I used to download my live site database onto my development
# server when I used a web host that used cPanel, but didn't give me access to
# mysqldump over SSH (because they had Jailshell enabled).
# Note: The database name (DBNAME) excludes the account name prefix - i.e.
# "dbname" not "sitename_dbname".
curl http://USERNAME:PASSWORD@HOSTNAME:2082/getsqlbackup/DBNAME.sql.gz \
# This is how I ensure a Python script is launched as root, and automatically
# call 'sudo' to re-launch it as root if not.
# I found it useful to check the parameters are valid *before* re-launching as
# root, so I don’t have to enter the sudo password if there is a problem with
# the parameters, or I just want the help message.
import os
import sys

How to add a simple "star" flag to posts (a la Gmail).

This works by adding the "Starred" category to the post when the Star button is clicked, and removing it when Unstar is clicked. It was written for a private, single-user site - it doesn't support multiple users having different sets of starred posts.

It uses ajax, so it is fast and doesn't require a page reload.

Tested against WordPress 3.0.3.

Also see:

# How to detect whether input is from keyboard, a file, or another process.
# Useful for writing a script that can read from standard input, or prompt the
# user for input if there is none.
# Source:
if readlink /proc/$$/fd/0 | grep -q "^pipe:"; then
# Pipe input (echo abc | myscript)
elif file $( readlink /proc/$$/fd/0 ) | grep -q "character special"; then
# Terminal input (keyboard)
View filosofo-comments-preview-count-fix.php
// Filosofo Comments Preview [1] is a WordPress plugin that lets you preview
// comments on your blog before you submit them.
// In the current version (1.5) it doesn't increment the number of posts, so it
// still says "there are no comments" when you click Preview, even though the
// previewed comment is directly under it.
// This little addition to the plugin will correct that - or you can put this in
View starred-posts-widget.php
// This is a modification to the theme's functions.php that adds a widget to
// list all of the posts in the "Starred" category.
// Also see: Toggle "Starred" Category -
// It has no user-configurable options, because I just wanted it to do this one
// thing. (There may be plugins that do this and more, but I didn't take the
// time to search.)
View redirect-after-publish-v1.php
// Redirect to the post/page itself after publishing or updating a post in
// WordPress. This code is from the WordPress forum [1], modified so it doesn't
// redirect when saving a draft.
// [1]:
add_filter('redirect_post_location', function($location)