Skip to content

Instantly share code, notes, and snippets.

View KendallHopkins's full-sized avatar

Kendall Hopkins KendallHopkins

View GitHub Profile
<?php
function test( array $array )
{
$closure = function() use ( $array ) {
var_dump( $array );
yield "hi";
};
return $closure();
}
<?php
class Thread
{
private $_socket;
private $_pid = NULL;
function __construct( Closure $closure )
{
SOURCE_FOLDER=~/SUF
//Install Xcode
http://itunes.apple.com/us/app/xcode/id448457090?mt=12
//checkout source
git clone git@github.com:SimpleUpdates/SUFramework.git $SOURCE_FOLDER --recursive
//clean /opt
rm -Rf /opt
@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
<?php
function testPropelBug()
{
$log1 = new DB_log();
$log1->save();
$log2 = new DB_log();
$log2->save();
<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">
$query = DB_store_categoryQuery::create();
$query->joinstore_categoryRelatedById("a");
$query->with( "a" );
$results = $query->find();
var_dump( $results );
#!/bin/sh
if ps ax | grep -v grep | grep rsync > /dev/null
then
echo "command is still running"
else
echo "command started"
rsync ...
fi
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
<?php
class MutableEventHeap extends SplMinHeap
{
private $_event_array = array();
function compare( $event1 , $event2 )
{
if( $event1->time > $event2->time )