Skip to content

Instantly share code, notes, and snippets.

Received: by 10.224.182.17 with SMTP id ca17mr1020073qab.31.1316718394779;
Thu, 22 Sep 2011 12:06:34 -0700 (PDT)
Received: by 10.224.182.17 with SMTP id ca17mr1020072qab.31.1316718394761;
Thu, 22 Sep 2011 12:06:34 -0700 (PDT)
Return-Path: <tchrist@nationalfield.org>
Received: from mail-vw0-f52.google.com (mail-vw0-f52.google.com [209.85.212.52])
by mx.google.com with ESMTPS id eq6si7151923qab.114.2011.09.22.12.06.34
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 22 Sep 2011 12:06:34 -0700 (PDT)
@tchrist
tchrist / gist:1328966
Created October 31, 2011 21:10
LL - iterator
Implement a linked list and supporting classes:
LinkedList implementing the Iterator interface: http://php.net/manual/en/class.iterator.php
class LinkedList
Node $root;
//additionally, implement the functions below:
GetElements(); //returns an array of all elements in the linked list
insert($val); //insert a value at the current position in the linked list
delete(); //delete the current value in the linked list
@tchrist
tchrist / gist:1368610
Created November 15, 2011 22:39
typing
/**
* @given /^I have typed in "([^"]*)" to "([^"]*)"$/
*/
public function typeInToElement($string, $element)
{
$node = $this->getSession()->getPage()->find('css', $element);
$driver = $this->getSession()->getDriver();
$browser = $driver->getBrowser();
$driver->click($node->getXPath());
for($i = 0; $i < strlen($string); $i++) {
var x = $('div.ui-layout-center').getElementsByTagName("script");
for (var i=0; i < x.length; i++)
{
eval(x[i].text);
}
$specifiedTag = 'foo';
$found = false;
$tags = $item->getHashTags();
$found = in_array($specifiedTags, $tags);
if(!$found) {
$comments = $item->getComments();
foreach($comments as $comment) {
$tags = $comment->getHashTags();
$found = in_array($specifiedTags, $tags)
if($found) {
--- a/lib/NF/Email.php
+++ b/lib/NF/Email.php
@@ -116,20 +116,16 @@ abstract class NF_Email
public function send()
{
- if (!$this->canSend()) {
- return false;
- }
-
$this->addOptions(array(
+ new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'frontend'),
new sfCommandOption('env-suffix', null, sfCommandOption::PARAMETER_OPTIONAL, 'The enviroment suffix.', 'dev'),
new sfCommandOption('debug', null, sfCommandOption::PARAMETER_NONE, 'Enable debug'),
new sfCommandOption('disable-fork', null, sfCommandOption::PARAMETER_NONE, 'Disable PCNTL Forking'),
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/07-Databases
dev:
propel:
param:
classname: DebugPDO
debug:
realmemoryusage: true
details:
@tchrist
tchrist / gist:2853880
Created June 1, 2012 17:36
nginx rewrites for public login
location /login {
proxy_pass https://clientsetup.nationalfield.com/sso;
}
location /sso/lookup {
proxy_pass https://clientsetup.nationalfield.com/sso/lookup;
}
location /css {
rewrite ^/css/212_public.css https://clientsetup.nationalfield.com/css/212_public.css;
@tchrist
tchrist / gist:3099683
Created July 12, 2012 17:58
testing winrar
tchrist@tchrist-desktop:~/workspace/app$ phpunit test/unit/
PHP Notice: Undefined property: NF_GetStarted_ChecklistTest::$appSettings in /home/tchrist/workspace/app/test/unit/lib/NF/GetStarted/ChecklistTest.php on line 30
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745