Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Filip Procházka fprochazka

🏠
Working from home
View GitHub Profile
@andyshinn
andyshinn / composer.json
Last active Apr 27, 2022
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 Jan 19, 2021
Č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