Skip to content

Instantly share code, notes, and snippets.

View jalogut's full-sized avatar

Juan Alonso jalogut

View GitHub Profile
@jalogut
jalogut / phpstorm-init-vcs-roots.php
Created July 13, 2017 12:48
Script to automatically init all vcs roots inside a project
#!/usr/bin/env php
<?php
class PhpStormVcsRoots
{
private $rootPath = ".";
private $maxDepth = "4";
private $configPath = ".idea/vcs.xml";
public function updateVcsRootsConfig()
#!/bin/bash
# Run this script whenever you need to update the logrotate configuration for your website.
# You can do that in 3 ways:
# a) Execute this script Manually
# b) Schedule it on a cronjob
# c) Execute it every time before the rotation takes place. Call this script on first line of your logrotate "/etc/cron.daily/logrotate"
# -e = stop if something fails
# -u = fail if you try to use an unset variable.
set -eu
@jalogut
jalogut / or-example.php
Last active January 28, 2016 08:30
SearchCriteria OR Example for Magento 2
<?php
declare(strict_types = 1);
namespace Training5\VendorRepository\Controller\Test;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Api\Filter;
use Magento\Framework\Api\FilterBuilder;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;