Skip to content

Instantly share code, notes, and snippets.

View ckimrie's full-sized avatar

Christopher Imrie ckimrie

View GitHub Profile
<?php
/*
EE2 hidden configuration variables
Last updated: Jun 20 2010
Obtain this list by putting print_r($this->EE->config->config); on a PHP-enabled template.
See: http://eeinsider.com/tips/view/config-overrides-for-ee-1-and-2/
*/
<?php
/*
EE2 hidden configuration variables
Last updated: Jun 20 2010
Obtain this list by putting print_r($this->EE->config->config); on a PHP-enabled template.
See: http://eeinsider.com/tips/view/config-overrides-for-ee-1-and-2/
*/
@ckimrie
ckimrie / .htaccess
Created November 10, 2011 12:18
ExpressionEngine index.php removal with Google Analytics Compatibility
#################################################################################
#
# - ExpressionEngine index.php ModRewrite Removal -
# compatible with Google Analytics Tracking
#
##################################################################################
RewriteEngine on
@ckimrie
ckimrie / gist:3312619
Created August 10, 2012 08:32
Example extension that allows you to modify the final ExpressionEngine CP output
<?php
/**
* Modifying the final CP Output
*
* This extension demonstrates how you can access and modify the final ExpressionEngine
* CP output. It is not a hack, but it is a new technique that to my knowledge has not
* been used before in an EE addon.
*
* This has not been road tested and its side effects are unknown, so use this at your own risk.
@ckimrie
ckimrie / jquery.simple-placeholder.min.js
Last active December 11, 2015 11:28
Handy plugin that takes a simpler approach to tackling placeholder attribute support in older browsers. If you have a lot of logic & validation occuring on form submit, existing plugins can struggle to behave themselves. Instead of attempting to simulate the placeholder text inline with the input like most plugins, this simply creates a text nod…
/**
* Simple Placeholder Fallback
*
* A simpler and more robust method for adding fallback input placeholder support for
* browsers that dont support the attribute. No value spoofing, hidden input creation
* or other crazy methods. Simply appends the placeholder text after the input as help
* text.
*
* Simple & works with even the craziest validation and form submission logic, which is where
* the other techniques struggle.
@ckimrie
ckimrie / airport_codes_helper.php
Created February 11, 2013 15:06
IATA 3-letter Airport code to Airport name converter
<?php
/**
* 3-letter IATA Airport Code to Airport Name conversion
*
* Data Sourced from http://www.photius.com/wfb2001/airport_codes_alpha.html
*
* Usage:
*
* $airport_name = Airport::code("ACA");
@ckimrie
ckimrie / city_code_helper.php
Created February 11, 2013 16:06
3 letter IATA City code to City name converter
<?php
/**
* 3-letter IATA City Code to CityName conversion
*
* Usage:
*
* $city_name = City::code("LON");
* // "London"
*
@ckimrie
ckimrie / country_helper.php
Created February 12, 2013 15:51
2 letter ISO Country Code to Country name converter
<?php
/**
* 2-letter ISO Country Code to Country Name conversion
*
* Usage:
*
* $country_name = Country::code("GB");
* // "United Kingdom"
*
<?php
//Instead of using ee_debug_toolbar_modify_output as the primary mechanism of adding content to the toolbar,
//we add an additional extension hook for adding content
class Eedt_memory_history_ext {
/**
* Method called for adding toolbar panels
* @param $view Eedt_view
@ckimrie
ckimrie / loadScript.js
Last active July 24, 2018 11:06
Lightweight script loader with callback
/**
* Lightwright JS Loader
*
* @author Christopher Imrie
*
* @param {String} name URL to JS file
* @param {Function} cb Callback function
* @return {null}
*/
function loadScript(/** string */ name, /** Function*/ cb) {