Skip to content

Instantly share code, notes, and snippets.

<?php
use EpgData\EpgData;
use EpgData\DataIterator\BroadcastIterator;
use EpgData\DataIterator\CategoryIterator;
use EpgData\DataIterator\ChannelIterator;
use EpgData\DataIterator\GenreIterator;
$epg = new EpgData('http://www.epgdata.com/index.php', 'YOUR_KEY');
$broadcasts = $epg->getBroadcastIterator(0); // offset can be 0-6
<a href="http://advertiser.com/affiliate.php?id=123"
onclick="_gaq.push(['_trackEvent', 'Affiliate', 'ServerGrove', '200x200']);">
<img src="/servergrove.png" width="200" height="200">
</a>
<?php
$from = new \DateTime('today');
$to = new \DateTime('tomorrow');
$products = $dm->createQueryBuilder('MyBundle:Product')
->field('created_at')->range($from, $to)
->getQuery()
->execute();
<?php
$from = new \DateTime('today');
$to = new \DateTime('tomorrow');
$in_range = array('$gte' => $from, '$lt' => $to);
$products = $dm->getRepository('MyBundle:Product')
->findBy(array('created_at' => $in_range));
$ git push fork master
$ git add your/changes
$ git -m "some meaningful comment" your/changes
$ git pull origin master
$ git remote add fork https://github.com/yourname/ThatLibrary.git
<?php
$dm->flush(array('safe'=>true));
<?php
$dm = $this->container->get('doctrine.odm.mongodb.document_manager');
$dm->getSchemaManager()->ensureIndexes();