Skip to content

Instantly share code, notes, and snippets.

@vojtabiberle
vojtabiberle / ProductTag.php
Created February 8, 2018 18:29
Fixtures issue
<?php
namespace Eshop\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Eshop\Repository\ProductTagRepository")
* @ORM\Table(name="product_tag")
**/
#!/bin/bash
# Realy simple and easy script for automatic background change of gnome shell screensawer wallpaper
# Install:
# 1. put this script somewhere
# 2. set script executable (chmod +x unsplash.sh)
# 3. add script to your crontab (crontab -e) [0 * * * * YOUR_PATH/unsplash.sh >/dev/null 2>&1]
PWD=$(dirname $(readlink -f $0))
### Keybase proof
I hereby claim:
* I am vojtabiberle on github.
* I am vojtabiberle (https://keybase.io/vojtabiberle) on keybase.
* I have a public key ASA3i0iQA93mo4WcVvgZlm1nxWYqtTYsbY0vKQBqtQBACwo
To claim this, I am signing this object:
<?php
class Foo {
public $str1 = 'hello';
protected $str2 = 'world';
private $str3 = 'meh';
public function __construct()
{
// just for fun
@vojtabiberle
vojtabiberle / Bootstrap3Form.php
Created October 9, 2015 11:03
Bootstrap 3 formuláře do Nette - namespace doplň podle podřeby
<?php
use Nette\ComponentModel\IContainer;
use Nette\Forms\Controls;
class Bootstrap3Form extends \Nette\Application\UI\Form
{
public function __construct(IContainer $parent = NULL, $name = NULL)
{
$this->setRenderer(new Bootstrap3FormRenderer());
@vojtabiberle
vojtabiberle / phinx.php
Last active July 27, 2021 14:38
Nette a Phinx integrace
<?php
/**
*
*
* Spouštět pomocí ./phinx.sh nebo pomocí php vendor/bin/phinx
*
* Obsah souboru ./phinx.sh:
* #!/bin/bash
* php vendor/bin/phinx $@
@vojtabiberle
vojtabiberle / dsn_ultimate_regex.php
Last active November 5, 2023 03:52
DSN ultimate regex parser
<?php
define ('DSN_REGEX', '/^((?P<driver>\w+):\/\/)?((?P<user>\w+)?(:(?P<password>\w+))?@)?((?P<adapter>\w+):)?((host=(?P<host>[\w-\.]+))|(unix_socket=(?P<socket_file>[\w\/\.]+)))(:(?P<port>\d+))?((;dbname=|\/)(?P<database>[\w\-]+))?$/Uim');
@vojtabiberle
vojtabiberle / wordpress_tag_more_dont_work.php
Created October 28, 2013 10:47
Wordpress, nefunguje tag <!--more--> ve výpisu článků
<?php
global $more;
$more = 0;
the_content('Read the full article...');
?>