-
Split directory in a branch in source repository
git subtree split -P <name-of-folder> -b <name-of-new-branch>
-
Add remote of source in destination repository and fetch
git remote add -f <source> <source-repository>
#!/bin/bash | |
branchlist() { | |
git for-each-ref -s --format '%(refname:short)' refs/heads/ | |
} | |
filter_stale() { | |
while read branch; do | |
(git rev-parse --verify --quiet "$branch"@{u} > /dev/null 2>&1 && git merge-base --is-ancestor "$branch"@{u} "$branch") || echo "$branch" | |
done |
#!/bin/bash | |
settings() { | |
SCRIPT_DIR="$(dirname "$0")" | |
} | |
main() { | |
request $@ | |
settings | |
run |
<?php | |
trait Enum | |
{ | |
private $value; | |
private function __construct($value) | |
{ | |
static $constants; |
<?php | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\ResponseHeaderBag; | |
trait MakeDownloadable | |
{ | |
/** | |
* @param Response $response | |
* @param string $filename |
<?php | |
namespace Shopery\Bundle\ShoperyBundle\CompilerPass; | |
use Shopery\Bundle\ShoperyBundle\Serializer\Deserializer; | |
use Shopery\Bundle\ShoperyBundle\Serializer\Serializer; | |
use Symfony\Component\Config\Definition\Exception\Exception; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Definition; |
<?php | |
class MyFormType extends AbstractType | |
{ | |
public funcion buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('username', 'text', [ | |
'required' => true, | |
'validation_groups' => new GroupSequence(['Default', 'Strict']), |
#!/bin/bash | |
if [[ -n "$ALLOW_XDEBUG" ]]; then | |
exit 0 | |
fi | |
QUIET=0 | |
while test $# -gt 0 | |
do | |
case "$1" in |
<?php | |
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
/** | |
* Helper function to create recursive nodes | |
*/ | |
function recursiveNode(string $name, callable $callback) |
Split directory in a branch in source repository
git subtree split -P <name-of-folder> -b <name-of-new-branch>
Add remote of source in destination repository and fetch
git remote add -f <source> <source-repository>
<?php | |
/** | |
* Copyright © 2015 Berny Cantos <[email protected]> | |
* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License Version 2 as | |
* published by Sam Hocevar. | |
* | |
* See http://www.wtfpl.net/about file for more details. |