Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@Kedrigern
Kedrigern / Column.php
Last active December 18, 2015 22:58
Just gist...
<?php
class Column extends \Nette\Object
{
/**
* @var string
*/
public $name;
/**
@Kedrigern
Kedrigern / LocaleForm.php
Last active December 18, 2015 02:59
Lokalizace: repository, presenter, formuláře
<?php
namespace BackendModule;
class LocaleForm extends BaseForm
{
/** @var */
protected $repository;
/** @var */
@Kedrigern
Kedrigern / NewList.php
Last active December 18, 2015 02:49
Verry simple grid for conrete app (no plans to extends to standalone component).
<?php
namespace BackendModule;
/**
* New List Control
*/
class NewList extends BaseControl
{
/**
@Kedrigern
Kedrigern / vcmi.sh
Last active December 17, 2015 12:19
vcmi installation script
#!/bin/bash
#==============================================================================
#
# FILE: homam-install.sh
#
# USAGE: homam-install.sh --data original_data [-v vcmi_version] dir
#
# DESCRIPTION: Installation script for vcmi
#
# AUTHOR: Ondřej Profant, ondrej.profant <> gmail.com
@Kedrigern
Kedrigern / Formik.php
Created May 15, 2013 19:07
Volání submitu formuláře z jiného handle
<?php
use \Nette\Application\UI\Form;
class Formik extends Form
{
public function __construct()
{
parent::__construct();
@Kedrigern
Kedrigern / UploadManager.php
Created May 15, 2013 09:49
Implements PHP infrastructure for http://blueimp.github.io/jQuery-File-Upload in Nette FW.
<?php
use Nette\Utils\Finder;
/**
* @todo fake delete (delete to global trash)
*/
class UploadManager extends \Nette\Object
{
/** @var string upload dir */
@Kedrigern
Kedrigern / HomepagePresenter.php
Last active March 26, 2016 09:20
Multiple file upload for Nette framework via HTML5 FormData (Ajax).
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function handleProcessImages()
{
$files = $this->getHttpRequest()->getFiles();
@Kedrigern
Kedrigern / mails.php
Last active December 16, 2015 12:19
Extract mail address in pointy brackets ("<", ">") from given string
<?php
/**
*
* Extract mail address in pointy brackets ("<", ">") from given string
*
* @author: Ondřej Profant <ondrej.profant <> gmail.com>, 2013
*
*/
@Kedrigern
Kedrigern / NumberMatching.php
Last active December 16, 2015 11:48
Regexp matchich if string with street name has orientation number too.
<?php
/**
*
* Regexp matchich if string with street name has orientation number too.
* Rules are for Czech Republic orientation numbers:
* a) number for 0-999
* b) may be supplemented by one letter
* @link http://www.czso.cz/csu/rso.nsf/i/cislo_orientacni
*
@Kedrigern
Kedrigern / @layout.latte
Last active April 7, 2016 19:25
Modální okna vyplňována dynamicky AJAXem bez JS kodu :)
{**
* My Application layout template.
*
* @param string $basePath web base path
* @param string $robots tell robots how to index the content of a page (optional)
* @param array $flashes flash messages
*}
<!DOCTYPE html>
<html>