This file contains hidden or 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
$(document).ready(function () { | |
$("#list2").jqGrid( | |
{ | |
url: '{{ path('edfa3ly_backend_banner_jq') }}', | |
datatype: "json", | |
colNames: ['ID', 'Status', 'Title'], | |
colModel: [ | |
{name: 'id', index: '_id', width: 300}, | |
{name: 'status', index: 'status', width: 300}, | |
{name: 'title', index: 'title', width: 300} |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
mongoc () | |
{ | |
php app/console doctrine:mongodb:cache:clear-metadata; | |
php app/console doctrine:mongodb:mapping:info; | |
php app/console doctrine:mongodb:generate:hydrators; | |
php app/console doctrine:mongodb:generate:proxies | |
} |
This file contains hidden or 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
Install update to apt-get | |
sudo apt-get install python-software-properties | |
PHP | |
————— | |
sudo add-apt-repository ppa:ondrej/php5 | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains hidden or 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
function getSortedIngredients() | |
{ | |
//workaround to sort ingredients by quantities collection | |
$iterator = $this->ingredients->getIterator(); | |
$iterator->uasort( | |
function ($a, $b) { | |
return ($a->getQuantity() > $b->getQuantity()) ? -1 : 1; | |
} | |
); | |
This file contains hidden or 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 | |
namespace Ma7shy\BackendBundle\Form\Type\Field; | |
use Doctrine\ODM\MongoDB\DocumentManager; | |
use Ma7shy\BackendBundle\Form\Transformer\ObjectToDocumentTransformer; | |
use Ma7shy\BackendBundle\Form\Transformer\ObjectToRefTransformer; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface, |
This file contains hidden or 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
/** | |
*@Route("/sendHello") | |
*/ | |
public function helloAction(Request $request) | |
{ | |
$data = $this->someModel->process($someInput); | |
//return something | |
} |
This file contains hidden or 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
/** | |
* @MongoDB\PreFlush | |
* @return ArrayCollection | |
*/ | |
public function orderSteps() | |
{ | |
//workaround to sort steps collection | |
$iterator = $this->steps->getIterator(); | |
$iterator->uasort( | |
function ($a, $b) { |
This file contains hidden or 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 | |
namespace OverrideBundle; | |
use Doctrine\ODM\MongoDB\Types\Type; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
class OverrideBundle extends Bundle | |
{ | |
public function __construct() |
This file contains hidden or 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
/** | |
* @Annotations\View(statusCode=200) | |
* @Annotations\Route("/reviews") | |
* @Annotations\QueryParam(name="place_id", strict=true, requirements="\d+", description="Place id "), | |
* @Annotations\QueryParam(name="offset", strict=true, requirements="\d+", default="0", description="offset (default is 0)"), | |
* @Annotations\QueryParam(name="limit", strict=true, requirements="\d+", default="5", description="limit (default is 5)"), | |
* @ApiDoc( | |
* statusCodes={ | |
* 200="Returned when successful", | |
* 400="Returned with invalid parameters" |
OlderNewer