Skip to content

Instantly share code, notes, and snippets.

View 0xPr0xy's full-sized avatar
🎯
Focusing

Peter IJlst 0xPr0xy

🎯
Focusing
View GitHub Profile
@0xPr0xy
0xPr0xy / check errors
Created August 25, 2015 07:13
check errors
check_errs()
{
# Function. Parameter 1 is the return code
# Para. 2 is text to display on failure.
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
# as a bonus, make our script exit with the right error code.
exit ${1}
fi
}
<services>
<service id="my_mailer" class="Acme\HelloBundle\Mailer">
<argument type="expression">service('mailer_configuration').getMailerMethod()</argument>
</service>
</services>
@0xPr0xy
0xPr0xy / ReferenceListener.php
Created July 16, 2015 09:56
ReferenceListener.php
<?php
namespace Gedmo\References;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\EventArgs;
use Doctrine\Common\Persistence\ObjectManager;
use Gedmo\Mapping\MappedEventSubscriber;
/**
@0xPr0xy
0xPr0xy / NodePagesConfiguration.php
Last active August 29, 2015 14:22
NodePagesConfiguration.php
<?php
namespace Kunstmaan\NodeSearchBundle\Configuration;
use Doctrine\ORM\EntityManager;
use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\MaskBuilder;
use Kunstmaan\NodeBundle\Entity\NodeVersion;
use Kunstmaan\NodeSearchBundle\Helper\IndexablePagePartsService;
use Kunstmaan\NodeSearchBundle\Helper\SearchBoostInterface;
use Kunstmaan\NodeSearchBundle\Helper\SearchViewTemplateInterface;
@0xPr0xy
0xPr0xy / SearchconfigInterface
Created May 28, 2015 14:06
SearchconfigInterface
<?php
namespace Kunstmaan\SearchBundle\Configuration;
/**
* Interface for a SearchConfiguration
*/
interface SearchConfigurationInterface
{
/**
@0xPr0xy
0xPr0xy / service
Created May 13, 2015 14:07
service
/**
* @param ContainerInterface $container The Container
* @param Request $request The Request
* @param RenderContext $context The Render context
*
* @return void|RedirectResponse
*/
public function service(ContainerInterface $container, Request $request, RenderContext $context)
{
$security = $container->get('security.context');
(lldb) po self.saveButton
<UIButton: 0x796dd8e0; frame = (962 25; 42 42); hidden = YES; opaque = NO; layer = <CALayer: 0x796dda00>>
(lldb) po self.cancelButton
<UIButton: 0x796e0490; frame = (13 25; 42 42); hidden = YES; opaque = NO; layer = <CALayer: 0x796e05b0>>
(lldb) po self.cameraButton
<UIButton: 0x796dabb0; frame = (910 25; 42 42); opaque = NO; layer = <CALayer: 0x796dacd0>>
(lldb) po self.planningButton
@0xPr0xy
0xPr0xy / foreach.php
Created October 14, 2014 11:45
foreach.php
$a = array ('zero','one','two', 'three');
foreach ($a as &$v) {
}
foreach ($a as $v) {
echo $v.PHP_EOL;
}
@0xPr0xy
0xPr0xy / CanonicalMenuController.php
Created October 10, 2014 15:14
CanonicalMenuController.php
<?php
namespace BBG\UtrechtScienceParkWebsiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;