Skip to content

Instantly share code, notes, and snippets.

View jwage's full-sized avatar
💭
I am still here.

Jonathan H. Wage jwage

💭
I am still here.
View GitHub Profile
<?php
namespace App\Component\HttpKernel\CacheWarmer;
use Spork\Batch\Strategy\ChunkStrategy;
use Spork\ProcessManager;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate;
class SporkCacheWarmerAggregate extends CacheWarmerAggregate
{
@jwage
jwage / Cartesian.php
Created April 22, 2014 20:30
PHP Cartesian Function
<?php
$attributeValues = array(
'color' => array('Red', 'White', 'Blue'),
'size' => array(1, 2, 3, 4),
'fabric' => array('Cloth', 'Silk')
);
class Cartesian
{
// works in production
core:PRIMARY> db.test.insert({test:new Date('2014-01-29 03:00')})
core:PRIMARY> db.test.find().pretty()
{
"_id" : ObjectId("52e930ef400853587d69153f"),
"test" : ISODate("1970-01-01T00:00:00Z")
}
// does not work in other dev/local envs
<?php
namespace OpenSky\Bundle\APIBundle\Serializer;
use JMS\Serializer\JsonSerializationVisitor;
class ArraySerializationVisitor extends JsonSerializationVisitor
{
public function getResult()
{
[2012-03-14 15:01:20] doctrine.INFO: MongoDB query: { "update": true, "query": { "_id": ObjectId("4dbf6fb572989a7d77000000") }, "newObj": { "$set": { "wishListItems": [ { "_id": ObjectId("4f262a159b78273220000001"), "sellable": { "$ref": "sellables", "$id": ObjectId("4e540001b5743be315000001"), "$db": "opensky_devo" }, "createdAt": new Date("Tue, 30 Aug 2011 19:32:35 -0500"), "status": "auto_added", "slug": "r4384" }, { "_id": ObjectId("4f262a159b78273220000002"), "sellable": { "$ref": "sellables", "$id": ObjectId("4e693aa3b5743b053d0000a1"), "$db": "opensky_devo" }, "createdAt": new Date("Thu, 08 Sep 2011 18:35:07 -0500"), "purchasedAt": new Date("Thu, 08 Sep 2011 18:37:30 -0500"), "status": "purchased", "slug": "jrca" }, { "_id": ObjectId("4f262a159b78273220000003"), "sellable": { "$ref": "sellables", "$id": ObjectId("4e60e2f7b5743b19790000d1"), "$db": "opensky_devo" }, "createdAt": new Date("Mon, 12 Sep 2011 20:43:11 -0500"), "status": "manually_added", "slug": "gjr22h337" }, { "_id": ObjectId("4f262a159b7
<?php
$qb = $dm->createQueryBuilder();
$qb->addOr($qb->expr()->field('email')->equals($username));
$qb->addOr($qb->expr()->field('username')->equals($username));
$user = $qb->getQuery()->getSingleResult();
CREATE TABLE IF NOT EXISTS `offices` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city` varchar(22) NOT NULL,
`country` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
INSERT INTO `offices` (`id`, `city`, `country`, `phone`) VALUES
He should have presented it when he was "applying" for the job like all other presidential applicants. He gave me the impression that he felt he was above the law, not that he was hiding anything, but his continued disrespect for the rules caused the suspicion. I hope it's finally put to rest and we can get on to more important things. Though I'm sure the next question will be his implied citizenship through his step father and that there is no record of him reclaiming his American status. No matter who the president is - there will be those who have to pick at what ever piece of lint they can find or imagine. I am far more concerned about the current and future state of our country.
$uow->expects($this->once())
->method('getDocumentIdentifier')
->with($document1)
->will($this->returnValue(1));
$uow->expects($this->once())
->method('getDocumentIdentifier')
->with($document2)
->will($this->returnValue(2));
public function findByThisMonthToTodayOrderCount(\DateTime $firstDayOfMonth, \DateTime $currentDatetime)
{
$currentDatetimeString = $currentDatetime->format('Y-m-d');
$firstDayOfMonthString = $firstDayOfMonth->format('Y-m-d');
/*
$qb = $this->createQueryBuilder();
$qb->add('select', 'COUNT(*) as targetAmount, orders.created as targetMonth');
$qb->add('from', self::ORDER_CLASS.' as orders');