Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
Block or report user

Report or block fprochazka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andyshinn
andyshinn / composer.json
Last active Oct 28, 2019
Docker Compose PHP Composer Example
View composer.json
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@Solution
Solution / DoctrineExtension.php
Last active Jul 3, 2019
Gedmo extension for Kdyby\Doctrine and some changes in Gedmo\DoctrineExtensions
View DoctrineExtension.php
<?php
namespace Gedmo;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\ORM\Mapping\Driver as DriverMappingORM;
use Doctrine\Common\Persistence\Mapping\Driver as DriverORM;
use Doctrine\ODM\MongoDB\Mapping\Driver as DriverMongodbODM;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Annotations\CachedReader;
View Presenter.php
<?php
public function createComponent($name)
{
$ucname = ucfirst($name);
$method = 'createComponent' . $ucname;
if ($ucname !== $name && method_exists($this, $method)) {
$reflection = $this->getReflection()->getMethod($method);
if($reflection->getName() !== $method) {
return;
}
@lukas-vlcek
lukas-vlcek / gist:4673027
Last active Aug 30, 2016
Čeština v elasticsearch
View gist:4673027
#!/bin/sh
# download
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.zip
# unzip and start
unzip elasticsearch-0.20.4.zip
cd elasticsearch-0.20.4
# remove data in case you have defined some analyzers in the past (e.g. stop/start)
rm -rf data/
View DoctrineQueryBuilderBuilder.php
/**
* @author Jan Marek
*
* @method QueryBuilderBuilder andWhere() andWhere(\mixed $where)
* @method QueryBuilderBuilder orderBy() orderBy(\string $sort, \string $order = null)
* @method QueryBuilderBuilder from() from(\string $from, \string $alias, \string $indexBy = null)
* @method QueryBuilderBuilder select() select(\string $select = null)
* @method QueryBuilderBuilder addSelect() addSelect(\string $select = null)
* @method QueryBuilderBuilder setMaxResults() setMaxResults(\int $maxResults)
* @method QueryBuilderBuilder setFirstResult() setFirstResult(\int $firstResults)
@vojtech-dobes
vojtech-dobes / MultiAuthenticator.php
Created Aug 31, 2012
Multiple ways of authentication in Nette
View MultiAuthenticator.php
<?php
namespace VojtechDobes\NetteSecurity;
use Nette\InvalidArgumentException;
use Nette\Security\IAuthenticator;
use Nette\Security\IIdentity;
/**
View Google.php
<?php
use \Nette\Utils\Json;
/**
* Minimalistic Google OAuth2 connector
* @author Mikuláš Dítě
* @license BSD-3
*/
class Google extends Nette\Object
@mishak87
mishak87 / Router.php
Created May 24, 2012
Router for API REST like methods
View Router.php
<?php
namespace ApiModule;
use Nette,
Nette\Application\Request;
class Router extends Nette\Object implements Nette\Application\IRouter
{
@JanTvrdik
JanTvrdik / add_pull_request_to_issue_github.sh
Last active Jun 6, 2016
Add pull request to existing issue on github
View add_pull_request_to_issue_github.sh
#!/bin/bash
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)"
current_branch=${current_branch##refs/heads/}
github_username="JanTvrdik"
github_token="..."
if [[ $current_branch = "(unknown)" ]]
then
You can’t perform that action at this time.