Skip to content

Instantly share code, notes, and snippets.

@farconada
farconada / gist:7b3327a7ddc23a6501af
Created January 19, 2015 19:20
Doctrine 2.5-dev getLoadedMetadata() returns entries that arent ClassMetadataInfo
// Loads NewProductCommand into Class Metadata
public function indexAction()
{
$productCollection = $this->productRepository->findAll();
$response = $this->responseGenerator->okResponse();
$response->setContent(
$this->templating->render('FerOwnShopUIBackendBundle:Product:index.html.twig',
[
'productCollection' => $productCollection,
@farconada
farconada / Error
Last active August 29, 2015 14:14
Behat bug?
Cannot change the ID of an active session (500 Internal Server Error)
@farconada
farconada / Async HTTP integration with PHP
Last active October 28, 2015 08:13
Async HTTP integration with PHP
As a way to integrate microservices I want to use HTTP calls and avoid the use of a MQ (Message Queue).
If the app is small and contained in one host you could avoid the use of MQ.
Description of the scenario:
I have one app (made with Symfony. Call it MainApp) and one microservice (made with Sylex. Call MicroApp), both served using PHP-FPM NGINX
1) MainApp calls an URL POST /api/internal/do-something with Guzzle,
2) then MicroAPP do its work (it takes long)
3) MicroApp calls an URL from /api/internal/i-have-finished
@farconada
farconada / CardItem.jsx
Last active August 17, 2016 10:09
CardItem
import React from 'react';
import {Card, CardActions, CardMedia, CardTitle, CardText} from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
import IconButton from 'material-ui/IconButton';
import Divider from 'material-ui/Divider';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import FavoriteBorderIcon from 'material-ui/svg-icons/action/favorite-border';
import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert';
import { connect } from 'react-redux';
OverlayEntry _buildOverlayFeedback(BuildContext context, String tituloEvento) {
return OverlayEntry(
builder: (context) => Material(
child: Container(
width: double.infinity,
height: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
@farconada
farconada / detnet.py
Last active June 14, 2019 09:35
DetNet backbone for retinanet
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@farconada
farconada / Vagrantfile
Created November 17, 2021 19:41
K0s network problem
IMAGE_NAME = "bento/ubuntu-20.04"
K8S_NAME = "k8scluster"
MASTERS_NUM = 1
MASTERS_CPU = 2
MASTERS_MEM = 2048
NODES_NUM = 4
NODES_CPU = 2
NODES_MEM = 3072