Skip to content

Instantly share code, notes, and snippets.

@airways
airways / 1 dist.config.php
Created November 1, 2011 00:44
Simple, single ExpressionEngine configuration file to override almost all paths and server settings. As used by @airways and @litzinger.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Simple, single configuration file to override almost all paths and server settings. As used by @airways
// and @litzinger.
// Only check in the default as dist.config.php, set your version control system to ignore config.php so that
// local users and each instance (staging, production) can have their own settings.
// These config files are mainly meant to be used on a shared development server used by all developers,
// although it works almost as well for local development as well.
@airways
airways / mod.extendedchannel.php
Created October 28, 2011 15:52
ExpressionEngine: Extending a core or third party module or plugin
<?php
class ExtendedChannel {
public __construct()
{
$this->EE = &get_instance();
}
public function extended_entries()
{
@airways
airways / SUSHI_Model.php
Created August 29, 2011 02:20
CodeIgniter base model classes
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* SUSHI_Model provides a base model class that interacts with SUSHI_ModelRow to
* make saving and loading data easier.
*
* @package default
* @author Isaac Raway
**/
class SUSHI_Model extends CI_Model
@airways
airways / QUERY_PARAM.md
Created July 19, 2011 22:24
ExpressionEngine: new QUERY_PARAM protocol that always works

QUERY_PARAM Protocol

This is a simple technique which should work on ALL hosts to allow ExpressionEngine to handle URLs without index.php in them. Hopefully EllisLab will add this as a built-in option soon.

IJR

@airways
airways / gist:877661
Created March 19, 2011 17:52
Lightweight Mac OS X / Linux
  • X11.app X server
  • Fink and MacPorts package managers
    • (may replace MacPorts with Homebrew and use Fink only for things not found in Homebrew such as FireFox and nedit)
  • From source tar balls
    • dwm tiling window manager
  • Fink
    • FireFox (browser)
    • Alpine (email)
  • nedit - language mode files (including PHP): http://www.nedit.org/ftp/contrib/highlighting/

Installing and configuring dwm on OS X

  1. Install X11.app (it's on the OS X install disk or something.)

  2. Install dwm. You have to customize config.h a bit:

    1. Replace { MODKEY|ShiftMask, XK_q, quit, {0} }, with { MODKEY|ControlMask, XK_q, quit, {0} }, to avoid colliding with the Log Out shortcut in the Apple menu.

    If you install dwm from Homebrew, brew install dwm, this is done automatically.

Installing and configuring dwm on OS X

  1. Install X11.app (it's on the OS X install disk or something.)

  2. Install dwm. You have to customize config.h a bit:

    1. Replace { MODKEY|ShiftMask, XK_q, quit, {0} }, with { MODKEY|ControlMask, XK_q, quit, {0} }, to avoid colliding with the Log Out shortcut in the Apple menu.

    If you install dwm from Homebrew, brew install dwm, this is done automatically.

@airways
airways / webdelay.rb
Created February 19, 2011 18:15
Inverted the webdelay ruby script written by someone on reddit (http://www.reddit.com/tb/fo276) - everything *except* the listed sites is delayed by 10 seconds
#!/usr/bin/ruby
require 'webrick'
require 'webrick/httpproxy'
require 'getoptlong'
opts = GetoptLong.new(
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--file", "-f", GetoptLong::REQUIRED_ARGUMENT ],
[ "--port", "-p", GetoptLong::REQUIRED_ARGUMENT ],
@airways
airways / gist:795258
Created January 25, 2011 17:26
Am I making Baby Jesus cry?
<?php
<table class="lokiTable workflowSteps" id="workflowSteps"><tbody>
<tr>
<th class="first">Step</th>
<th class="commands">Commands</th>
</tr>
<?php function step($step, $hidden, $statuses, $member_groups) { ?>
<tr class="step" <?php if($hidden == 'hidden') echo 'id="stepTemplate" style="display: none;"'; ?>>
<td>
<div class="itemWrapper">
@airways
airways / gist:793814
Created January 24, 2011 19:47
Something doesn't seem right
array
'entry_id' => string 'entry_id' (length=8)
'status' => string 'status' (length=6)
'weblog' => string 'weblog' (length=6)
'weblog_id' => string 'weblog_id' (length=9)
'weblog_short_name' => string 'weblog_short_name' (length=17)
'url_title' => string 'url_title' (length=9)
'author_id' => string 'author_id' (length=9)
'edit_link' => string 'edit_link' (length=9)
'old_step_no' => string 'old_step_no' (length=11)