Skip to content

Instantly share code, notes, and snippets.

View bshaffer's full-sized avatar

Brent Shaffer bshaffer

View GitHub Profile
@bshaffer
bshaffer / _list_td_stacked.php
Created April 9, 2011 05:00
_list_td_stacked.php
<td colspan="13">
<?php echo __('%%id%% - %%first_name%% - %%last_name%% - %%email_address%% - %%username%% - %%algorithm%% - %%salt%% - %%password%% - %%is_active%% - %%is_super_admin%% - %%last_login%% - %%created_at%% - %%updated_at%%', array('%%id%%' => link_to($sf_guard_user->getId(), 'sf_guard_user_sf_guard_user_old_edit', $sf_guard_user), '%%first_name%%' => $sf_guard_user->getFirstName(), '%%last_name%%' => $sf_guard_user->getLastName(), '%%email_address%%' => $sf_guard_user->getEmailAddress(), '%%username%%' => $sf_guard_user->getUsername(), '%%algorithm%%' => $sf_guard_user->getAlgorithm(), '%%salt%%' => $sf_guard_user->getSalt(), '%%password%%' => $sf_guard_user->getPassword(), '%%is_active%%' => get_partial('sf_guard_user_old/list_field_boolean', array('value' => $sf_guard_user->getIsActive())), '%%is_super_admin%%' => get_partial('sf_guard_user_old/list_field_boolean', array('value' => $sf_guard_user->getIsSuperAdmin())), '%%last_login%%' => false !== strtotime($sf_guard_user->getLastLogin()) ?
<?php
class mycontrollerActions extends sfActions
{
public function executeSendAnEmail($r)
{
$emailBody = $this->getController()->getPresentationFor('mycontroller', 'email');
// yadda yadda
}
@bshaffer
bshaffer / tag.sh
Created January 12, 2011 16:50
tag from svn
### USAGE ###
#
# tag [-u username] [-p password] repository version [last-version]
#
# Typing in -u but not -p will prompt you for a password.
# Priving a last-version argument will create a diff file between the new version and last-version tag.
# repository is automatically appended to REPOROOT.
REPOROOT=http://myrepo.com
<?php
include dirname(__FILE__).'/sfPluginTestBootstrap.class.php';
$bootstrap = new sfPluginTestBootstrap();
$bootstrap->bootstrap();
$configuration = $bootstrap->getConfiguration();
$context = $bootstrap->getContex
<?php
class ForumTopic extends PluginForumTopic
{
public function getNewPostCount(sfUser $user)
{
if (!$user->isAuthenticated())
{
throw new InvalidArgumentException('This method can only be used with authenticated sfUser instances');
}
<?php
/**
* sfWidgetFormJQueryDateTime class
*
* Combines jQueryDate widget with a regular time widget, for use of jQuery date
* when time is required.
*
* @package default
* @author Brent Shaffer
*/
<?php
$browser
->info('Check submission of form')
->login()
->click('Register')
->setField('user_comment[first_name]', csFactory::firstName())
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
<?php
function array_msort($array, $cols)
{
// clean cols
$cols = (array) $cols;
foreach ($cols as $col => $order) {
if (is_int($col)) {
// unassociative array.
$cols[$order] = SORT_ASC;