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 | |
/** | |
* application/src/App/CoreBundle/DependencyInjection/AppCoreExtension.php | |
* | |
*/ | |
namespace App\CoreBundle\DependencyInjection; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\Config\FileLocator; |
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 | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $this->endpoint); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
curl_setopt($ch, CURLOPT_PROXY, 'http://user:[email protected]:3128'); |
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
cd /home/forge/default | |
git pull origin master | |
composer install --no-interaction --no-dev --prefer-dist | |
composer update fzaninotto/faker --no-interaction --dev --prefer-dist | |
php artisan migrate:reset | |
php artisan migrate --force | |
php artisan db:seed | |
npm cache clean | |
npm install |
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
sudo dpkg-reconfigure tzdata | |
sudo apt-get update | |
sudo apt-get install ntp | |
free | |
sudo fallocate -l 4G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile |
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 () { | |
'use strict'; | |
angular | |
.module('app') | |
.config(['$httpProvider', function ($httpProvider) { | |
$httpProvider.interceptors.push('busyInterceptor'); | |
}]) | |
.factory('busyInterceptor', busyInterceptor); |
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
var elixir = require('laravel-elixir'), | |
clean = require('rimraf'), | |
gulp = require('gulp'); | |
var config = { | |
bower_path: './bower_components', | |
assets_path: './assets', | |
build_path: './public/build' | |
}; |
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 | |
use Mockery as m; | |
class ProjectRepositoryTest extends TestCase | |
{ | |
public function testShouldCheckIfIsOwner() | |
{ | |
$mock = m::mock('CodeProject\Repositories\ProjectRepository[findWhere]'); | |
$mock->shouldReceive('findWhere')->once()->andReturn(true); |
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
No caso de comentários de uma unica linha uso o seguinte método | |
Colocar simbolo de comentario no Inicio da linha | |
tecla 0 leva-o para o inicio da linha (opcional) | |
teclas ctrl+v (fica em visual block) | |
com as teclas direcionais seleciona as linhas a comentar | |
Shift+i (I maiúsculo) | |
Um cursor de escrita vai aparecer na primeira linha selecionada- escrever o simbolo de comentario, i.e. '#' ou '//' | |
selecionar ESC e as linhas vão ficar todas comentadas |
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
# One liner to stop / remove all of Docker containers | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) |
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
This is an example how to perform multi-select faceting in ElasticSearch. | |
Selecting multiple values from the same facet will result in an OR filter between each of the values: | |
(facet1.value1 OR facet1.value2) | |
Faceting on more than one facet will result in an AND filter between each facet: | |
(facet1.value1 OR facet1.value2) AND (facet2.value1) | |
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh). |