Skip to content

Instantly share code, notes, and snippets.

{ext:lg_replace:haystack needles="{exp:channel_images:images entry_id="{entry_id}" backspace="1"}image_{image_id}|{/exp:channel_images:images}{videos}video_{entry_id}|{/videos}"}
{exp:article_pagination:show_page
token="page_break"
page="{get:article_page}"}
{article_body}
{/exp:article_pagination:show_page}
{/ext:lg_replace:haystack}
{exp:channel_images:images entry_id="{entry_id}"}
{ext:lg_replace:replacement needle="image_{image_id}"}
<?php
if (!$account_exists) // user doesn't exist in exp_members table, so we will create an EE account
{
$this->debug_print("Using LDAP for account creation...");
$unique_id = $FNS->random('encrypt');
$join_date = $LOC->now;
$sql = "INSERT INTO exp_members SET ".
"username = '$given_username', ".
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Hooked HTML Table Generating Class
*
* @package Wallace
* @subpackage Libraries
* @author Isaac Raway
* @link http://metasushi.com/
*/
{exp:lg_replace:haystack needles="{embed:image_needles}"}
{exp:weblog:entries
weblog="{embed:weblog}"
dynamic="off"
limit="1"
status="open"
disable="{global:disabled_params}"
category="{ss:current_cat_id}"
track_views="one"
entry_id="{embed:entry_id}"}
<?php
$xml_result = new SimpleXMLElement($W->return_data);
var_dump($xml_result);
echo "is_array = " . is_array($xml_result->entry) . "<br/>";
echo "count = " . count($xml_result->entry) . "<br/>";
?>
output:
object(SimpleXMLElement)[311]
@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)
@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 / 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 ],

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.