Skip to content

Instantly share code, notes, and snippets.

Gabriel Koen mintindeed

Block or report user

Report or block mintindeed

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mintindeed / .profile
Last active May 12, 2017
bash terminal
View .profile
# Tell ls to be colourful
export CLICOLOR=1
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# Solarized colors
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
if tput setaf 1 &> /dev/null; then
tput sgr0
mintindeed / dequeue.php
Created Sep 9, 2014
Way for storyform to dequeue default scripts and provide a mechanism for themes and plugins to exclude scripts and styles from storyform pages
View dequeue.php
// Contains a list of script handles that Storyform wants to remove
// The defaults should be a list of WP core script handles that you know you don't want
// @see
$default_scripts_blacklist = array(
$scripts_blacklist = apply_filters( 'storyform-scripts-blacklist', $default_scripts_blacklist );
mintindeed / ip-address.php
Created Feb 22, 2014
Yet another helper method for getting a user's real IP address
View ip-address.php
class IP {
* Helper method for validating the IP address.
* Handled IPv4 and filters out private and reserved ranges.
* @param $ip_address string
* @return $ip_address bool|string Returns false if invalid
protected function _validate_ip( $ip_address ) {
mintindeed / evil-include.php
Created Nov 24, 2013
Unintended global scope access. Example shows that even if you don't intend for a variable to be global, any code (by you or a 3rd party) can gain access and have its way with it.
View evil-include.php
function innocent_function() {
global $foo;
$foo = new Foobar($foo);
class Foobar {
public function __construct($original_value) {
echo 'I just did something evil.' . PHP_EOL;
View akismet.php
* @package Akismet
Plugin Name: Akismet
Plugin URI:
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
Version: 2.5.9
Author: Automattic
View pmc-force-plugins.php
$GLOBALS['pmc_required_plugins'] = array(
mintindeed /
Created Aug 14, 2013
Simple bash script for managing a VirtualHost VM for local web development.
#! /bin/bash
if [ -z $2 ]; then
mintindeed /
Created Aug 14, 2013
Simple (old: Snow Leopard I thinkg) bash script for managing a local OS X web server.
#! /bin/bash
MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/ -u root"
if [ $1 = "start" ]; then
sudo $MYSQL start
echo "Starting php-fpm ..."
mintindeed / client.php
Created Jul 28, 2013
This is a very simple API authentication method. It doesn't do any kind of flood protection, for example. In general an OAuth implementation would be better.
View client.php
$server_url = '' . time();
$shared_secret = 'random string of text'; // This is the same in server and client
$public_key = 'hello world'; // Each client has its own allowed key, this key is the same in the server and client
$headers = array(
'x-pmc-key: ' . $public_key,
'x-pmc-signature: ' . md5( $public_key . $shared_secret ),
View gist:5777729
jQuery(':button, :submit, #post-preview, .submitdelete', '#submitpost').each(function(){
var t = jQuery(this);
if ( t.hasClass('button-primary') )
t.prop('disabled', true);
t.on('click', function() {
You can’t perform that action at this time.