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 | |
namespace AppBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; |
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
// 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 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
#%RAML 0.8 | |
title: examle | |
version: 1.0 | |
baseUri: http://example.local/api | |
traits: | |
- secured: | |
description: Some requests require authentication | |
headers: | |
X-User: |
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
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' | |
wget http://ipinfo.io/ip -qO - |
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 | |
namespace AppBundle\EventListener; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\Exception\HttpException; | |
/** |
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
/** | |
* Image Resize | |
* | |
* @param $attachment_id | |
* @param $width | |
* @param $height | |
* @param bool $crop | |
* @return bool|string | |
*/ | |
function rw_image_resize( $attachment_id, $width, $height, $crop = true ) |
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
class ArrayMergeUtil | |
{ | |
/** | |
* @param array $array | |
* | |
* @return array | |
*/ | |
public static function flatArrayAndSumValues(array $array) | |
{ | |
$result = []; |
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
Eliminar todos contenedores | |
$ docker rm $(docker kill $(docker ps -aq)) | |
Eliminar todas imágenes | |
$ docker rmi $(docker images -qf "dangling=true") |
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
{% extends 'SonataAdminBundle::standard_layout.html.twig' %} | |
{% block side_bar_after_nav %} | |
YOUR CUSTOM MENU | |
{% endblock %} |
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
function getPaginatedElements(getResourcePromise, progressFn, limit = 25, offset = 0, elements = []) { | |
return new Promise((resolve, reject) => | |
getResourcePromise({limit, offset}) | |
.then(response => { | |
const newElements = elements.concat(response.records); | |
if (response.records.length === 0) { | |
resolve(newElements); | |
} else { | |
progressFn && progressFn(elements); | |
getPaginatedElements(getResourcePromise, progressFn, limit, offset+limit, newElements) |
OlderNewer