This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setProfileImage($profile_image) | |
{ | |
$this->profile_image = $profile_image; | |
if ($profile_image instanceof UploadedFile) { | |
$this->setUpdatedAt(new \DateTime()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage; | |
class unitTest extends WebTestCase | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
class unitTest extends WebTestCase | |
{ | |
public function testUn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface MyAPI | |
{ | |
public function getThing(); | |
} | |
class MyApiImplentation implements MyAPI | |
{ | |
public function getThing() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /etc/profile | |
git init | |
mv base.iml $1.iml | |
cd .idea/ | |
cat modules.xml | sed "s/base/$1/g" > modules.xml.new | |
mv modules.xml.new modules.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH=$PATH:$HOME/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BadCharacterMungerFilter extends sfFilter | |
{ | |
public function execute($filterChain) | |
{ | |
$filterChain->execute(); | |
// Execute this filter only once | |
if ($this->isFirstCall()) { | |
$response = $this->getContext()->getResponse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\HttpKernel; | |
class SSLManagementListener | |
{ | |
private $domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function isEmailUnique($email_address) | |
{ | |
$qb = $this->createQueryBuilder('e') | |
->select('COUNT(e.id)') | |
->where('e.email_address = :email') | |
->setParameter('email', $email_address); | |
$result = $qb->getQuery()->getSingleScalarResult(); | |
if ($result > 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// here is how I suspect you are currently doing something. | |
// Assuming you have a piece of data you need to send back with your request processing: | |
function sendMyRequest(info) | |
{ | |
var response_callback = function(data) { | |
callMyActualReturnMethod(data, info); | |
} | |
$.get('/some/path', response_callback, 'json'); | |
} |