Skip to content

Instantly share code, notes, and snippets.

View gondo's full-sized avatar
🎯
Focusing

gondo gondo

🎯
Focusing
View GitHub Profile
@gondo
gondo / controller
Created July 22, 2014 18:57
KnpPaginatorBundle multiple paginators example
public function listAction()
{
$em = $this->getDoctrine()->getManager();
$repository = $em->getRepository('ExampleBundle:Entity');
$qb = $historyRepository->createQueryBuilder('EntityAlias');
$knpPaginator = $this->get('knp_paginator');
$paginationAAA = $knpPaginator->paginate(
$qb,
@gondo
gondo / KnpPaginatorQuerySubscriber
Last active August 29, 2015 14:07
fixing random pagination results in knp_paginator and mysql
<?php
namespace General\GeneralBundle\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Knp\Component\Pager\Event\ItemsEvent;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
class KnpPaginatorQuerySubscriber implements EventSubscriberInterface
@gondo
gondo / bookmarklet.js
Created August 12, 2015 15:19 — forked from aseemk/README.md
A bookmarklet for "selecting all" (technically, "toggling all") checkboxes on the Amazon AWS S3 console.
javascript:(function () {
document.domain = 'console.aws.amazon.com';
var spans = document.querySelector('iframe').contentDocument.querySelectorAll('tr.list-view-item[type] span.inner');
[].slice.call(spans).forEach(function (span) {
span.click();
});
})();
@gondo
gondo / ryanair-fe-apps-test
Created October 23, 2015 08:00 — forked from smcelhinney/ryanair-fe-apps-test
ryanair-fe-dev
## Ryanair.com FE Developer Tests
Choose 1 of the following web apps below, build it and submit it to giovagnolif@ryanair.com with the subject "Developer Test Web App". ZIP files or public Github URLs will be accepted.
Provide any build commands or runtime requirements (webserver required, extra packages, environment variables) in an INSTALLATION.txt file at the root of the project. The goal is to have the application as easily deployable as possible.
You may use a responsive framework (Foundation, Bootstrap) if you like, but customising the CSS (or SASS) will get you extra kudos. You must use AngularJS as the Javascript framework.
### Cheap flight finder
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
Date: Fri, 5 Jul 2013 22:41:03 -0500
Subject: [PATCH] Magento_CE_1.7.0.2_v1-CSRF_Patch
---
.../core/Mage/Catalog/Block/Product/Abstract.php | 85 ++++-
app/code/core/Mage/Catalog/Block/Product/View.php | 10 +-
.../core/Mage/Catalog/Helper/Product/Compare.php | 28 +-
app/code/core/Mage/Checkout/Helper/Cart.php | 26 +-
.../Mage/Checkout/controllers/CartController.php | 69 ++--
.../Checkout/controllers/OnepageController.php | 70 +++-
@gondo
gondo / LoginListener.php
Last active December 21, 2015 06:08
Symfony2 using security.contex in login listener
<?php
// option 1: to replace/extend DefaultAuthenticationSuccessHandler
// http://www.reecefowell.com/2011/10/26/redirecting-on-loginlogout-in-symfony2-using-loginhandlers/
// http://stackoverflow.com/questions/15918617/symfony2-extending-defaultauthenticationsuccesshandler
//
// option 2: to use 2 listeners, 1 for checking admin and second to observer response event and change it
// http://forum.symfony-project.org/viewtopic.php?t=37383
namespace My\UserBundle\EventListener;
@gondo
gondo / RequestListener.php
Created February 11, 2016 00:16
DB router
// src/AppBundle/EventListener/RequestListener.php
namespace AppBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class RequestListener
{
public function onKernelRequest(GetResponseEvent $event)
@gondo
gondo / default.vcl
Last active March 21, 2016 16:56
installing magento on AWS with php54, nginx, varnish
# file /etc/varnish/default.vcl
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
#backend default {
# .host = "127.0.0.1";

Running Magento Enterprise Edition with Facebook HipHop HHVM

Prerequisites

Hardware

MacBook Air (MBA) Mid 2012