Skip to content

Instantly share code, notes, and snippets.

View hiro-iFactory's full-sized avatar

Hiro hiro-iFactory

View GitHub Profile
@hiro-iFactory
hiro-iFactory / readme.txt
Last active August 29, 2015 14:07
How to compile wkhtmltopdf with static qt for OSX with Brew
1. Install the static qt:
brew install https://raw.github.com/npinchot/homebrew/wkhtmltopdf_static_qt/Library/Formula/qt-wkhtmltopdf.rb
2. Overwrite/Create the file /usr/local/Library/Formula/wkhtmltopdf.rb
3. brew install wkhtmltopdf
@hiro-iFactory
hiro-iFactory / datagrid-component.js
Created September 7, 2014 06:08
How to catch rowClicked event on Oro Datagrid Bundle
/*
Copy the original file:
vendor/oro/platform/src/Oro/Bundle/DataGridBundle/Resources/public/js/app/components/datagrid-component.js
to your bundle folder (e.g. src/Acme/Bundle/MyBundle/Resources/public/js/app/components/datagrid-component.js)
Add the custom code within the method build() as follows:
*/
/**
* Build grid
*/
@hiro-iFactory
hiro-iFactory / AutocompleteController.php
Last active August 29, 2015 14:05
Example of how not to use Oro Search Bundle for Auto-completion field (Data Flow: services.yml > MyFormType.php > AutocompleteController.php > Helper.php)
<?php
// src/Acme/Bundle/AcmeBundle/Controller/AutocompleteController.php
namespace Acme\Bundle\AcmeBundle\Controller;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
@hiro-iFactory
hiro-iFactory / common.js
Last active August 29, 2015 14:05
How to bind/unbind an event from Oro Datagrid as ditching to learn Backbone and implementing with jQuery
// src/Acme/Bundle/AcmeBundle/Resources/public/js/common.js
/*
You need to run the following commands at Symfony root directory to include this file to web/bundles/acme/js:
php app/console assets:install; php app/console assetic:dump
*/
define(['jquery'],
function($) {
$.fn.extend({
@hiro-iFactory
hiro-iFactory / BaseOrmRelationDatagridListener.php
Last active August 29, 2015 14:05
How to send multiple parameters to Oro Datagrid
<?php
// src/Acme/Bundle/AcmeBundle/EventListener/BaseOrmRelationDatagridListener.php
namespace Acme/Bundle/AcmeBundle\EventListener;
use Doctrine\ORM\QueryBuilder;
use Oro\Bundle\DataGridBundle\Datagrid\ParameterBag;
use Oro\Bundle\DataGridBundle\Datasource\Orm\OrmDatasource;