start new:
tmux
start new with session name:
tmux new -s myname
^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# forked by Gianluca Guarini | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
} |
<?php | |
#source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char | |
function replace_unicode_escape_sequence($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
} | |
function unicode_decode($str) { | |
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
} |
#!/bin/bash | |
usage() { | |
if [ ! -z $1 ]; then | |
echo -e "ERROR:\n" 1>&2 | |
fi | |
echo "Usage: $0 -f /path/to/README.md -u dockerhub-username [-r dockerhub-repo-prefix] -n repo-name" 1>&2 | |
exit 1; | |
} | |
while getopts ":r:u:f:n:" o; do |
<?php | |
declare(strict_types=1); | |
use Doctrine\ORM\EntityManagerInterface; | |
use ProxyManager\Factory\LazyLoadingValueHolderFactory; | |
use ProxyManager\Proxy\VirtualProxyInterface; | |
use Psr\Container\ContainerInterface; | |
use Swoole\ArrayObject; | |
use Swoole\Coroutine; |
<?php | |
namespace jkuchar\Doctrine\DBAL\Driver\PDOPgSql; | |
use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineOriginalDriver; | |
/** | |
* Adds ability to set search path to PostgreSQL driver | |
* @package App\Doctrine |
#!/usr/bin/env php | |
<?php | |
define('MIGRATIONS_DIR', 'app/DoctrineMigrations'); | |
list(, $previousHead, $currentHead) = $argv; | |
$excessMigrations = getExcessMigrations($previousHead, $currentHead); | |
rsort($excessMigrations); | |
removeExcessMigrations($excessMigrations, $previousHead); | |
addMissingMigrations(); |
$function = new Twig_SimpleFunction('qprw', function (array $replacements) { | |
parse_str($_SERVER['QUERY_STRING'], $qp); | |
foreach ($replacements as $k => $v) { | |
$qp[$k] = $v; | |
} | |
return '?'.http_build_query($qp); | |
}); |