Skip to content

Instantly share code, notes, and snippets.

View acelaya's full-sized avatar

Alejandro Celaya acelaya

View GitHub Profile
use Doctrine\ORM\EntityManagerInterface;
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use ProxyManager\Proxy\VirtualProxyInterface;
use Psr\Container\ContainerInterface;
use Swoole\ArrayObject;
use Swoole\Coroutine;
chrodriguez /
Last active November 10, 2022 21:39
How to update dockerhub readme automatically
usage() {
if [ ! -z $1 ]; then
echo -e "ERROR:\n" 1>&2
echo "Usage: $0 -f /path/to/ -u dockerhub-username [-r dockerhub-repo-prefix] -n repo-name" 1>&2
exit 1;
while getopts ":r:u:f:n:" o; do
jhorsman /
Last active March 29, 2024 05:25
Semantic versioning regex
Swader / qprw.php
Created June 14, 2015 10:42
$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);
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
use GuzzleHttp\Post\PostFile;
$request = $client->createRequest('POST', '');
$postBody = $request->getBody();
$readStream = $flysystem->readStream($fileLocation);
$postBody->addFile(new PostFile('test', $readStream);
$response = $client->send($request);
stefansundin /
Last active February 1, 2024 06:42 — forked from 8bitDesigner/
Git post-checkout and post-merge hooks to simplify bundling and other tasks.

Make bundleing and npm installing easy

These git hooks runs bundle or npm install automatically whenever you:

  • git checkout a new branch with a different Gemfile or package.json.
  • git pull a change to Gemfile or package.json.

How to install

  1. cd awesome_git_repo
#!/usr/bin/env php
define('MIGRATIONS_DIR', 'app/DoctrineMigrations');
list(, $previousHead, $currentHead) = $argv;
$excessMigrations = getExcessMigrations($previousHead, $currentHead);
removeExcessMigrations($excessMigrations, $previousHead);
GianlucaGuarini / post-merge
Last active August 22, 2023 20:54 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus -
# 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"
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 16, 2024 16:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname