Skip to content

Instantly share code, notes, and snippets.

View KendallHopkins's full-sized avatar

Kendall Hopkins KendallHopkins

View GitHub Profile
<?php
$test_array = array(
'<a href="/test">' =>
'<a href="/test">',
'<a href="path/relative">' =>
'<a href="basepath/path/relative">',
'<a href="path/relative ">' =>
public function save(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(SF_model_forum_postPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$review = ReviewQuery::create()
->joinWith('Review.Book')
->joinWith('Book.Author')
->joinWith('Book.Publisher')
->findOne();
$book = $review->getBook() // No additional query needed
$author = $book->getAuthor(); // No additional query needed
$publisher = $book->getPublisher(); // No additional query needed
<?php
class MutableEventHeap extends SplMinHeap
{
private $_event_array = array();
function compare( $event1 , $event2 )
{
if( $event1->time > $event2->time )
version:1
:debug:main epoch: in tree: 0 installed: 0
:debug:main erlang R14A_0 exists in the ports tree
:debug:main erlang R14A_0 +ssl is the latest installed
:debug:main erlang R14A_0 +ssl is active
:debug:main Merging existing variants '+ssl' into variants
:debug:main new fully merged portvariants: ssl +
:debug:main Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/erlang
:debug:main OS darwin/10.4.0 (Mac OS X 10.6) arch i386
:debug:main org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
#!/bin/sh
if ps ax | grep -v grep | grep rsync > /dev/null
then
echo "command is still running"
else
echo "command started"
rsync ...
fi
$query = DB_store_categoryQuery::create();
$query->joinstore_categoryRelatedById("a");
$query->with( "a" );
$results = $query->find();
var_dump( $results );
<table name="store_category" phpName="store_category">
<vendor type="mysql">
<parameter name="Charset" value="utf8"/>
</vendor>
<behavior name="timestampable"/>
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
<column name="name" type="varchar" required="true"/>
<column name="parent_id" type="integer" required="false"/>
<column name="is_displayed" type="boolean" required="true"/>
<foreign-key foreignTable="store_category" onDelete="CASCADE" onUpdate="CASCADE">
<?php
function testPropelBug()
{
$log1 = new DB_log();
$log1->save();
$log2 = new DB_log();
$log2->save();
@KendallHopkins
KendallHopkins / gist:1093795
Created July 19, 2011 21:40 — forked from mattleff/gist:1093785
The Cardinal Sins of SU Bug Reporting
  1. Multiple issues in the same ticket
  2. Insufficient vetting of ticket
  • Is duplicable is not a yes/no but a prerequisite(?)
  • What exactly do you have to do to reproduce the issue?
  1. Incorrect names
  • "no creation date"
  • "Shopping cart (transaction.php) is not charging the correct amount in FF 5.0 and IE 8.0+" – no need to mention the browsers unless it is a unique issue with a particular browser WHICH YOU SHOULD CHECK
  • "AR RSS"
  1. Resubmitting the same issue to increase visibility
  • A comment is good