Skip to content

Instantly share code, notes, and snippets.

View janmarek's full-sized avatar

Jan Marek janmarek

  • Prague, Czech Republic
View GitHub Profile
@janmarek
janmarek / FormMacros.php
Created March 28, 2010 21:30
Form macros
<?php
namespace Nette\Templates;
use Nette\Forms\Form;
use Nette\String;
/**
* Form macros
*
@janmarek
janmarek / MultipleFileUpload.php
Created April 23, 2010 15:59
HTML 5 multiple file upload
<?php
/**
* Nette Framework
*
* @copyright Copyright (c) 2004, 2010 David Grudl
* @license http://nettephp.com/license Nette license
* @link http://nettephp.com
* @category Nette
* @package Nette\Forms
@janmarek
janmarek / BaseForm.php
Created September 3, 2010 16:51
Nette datepicker
<?php
class BaseForm extends Nette\Application\AppForm
{
public function addDatePicker($name, $label = NULL, $cols = NULL, $maxLength = NULL)
{
return $this[$name] = new Nette\Forms\DatePicker($label, $cols, $maxLength);
}
}
@janmarek
janmarek / gist:572165
Created September 9, 2010 16:55
Gridito template macros
{gridito usersGrid}
{* top toolbar *}
{gridito.toolbar.button addUser text => "Nový uživatel", icon => "plusthick", plink => "add"}
{* columns *}
{gridito.column username text => "Uživatelské jméno", sortable => true}
{gridito.column name text => "Jméno", sortable => true}
{gridito.column mail text => "E-mail", sortable => true}
{gridito.column allowed text => "Aktivní", sortable => true}
{gridito.column created text => "Datum založení", sortable => true, dateTimeFormat => "j.n.Y"}
@janmarek
janmarek / SeoRouter.php
Created September 12, 2010 16:32
SEO router
<?php
/**
* Seo router
*
* @author Jan Marek
*/
class SeoRouter extends Nette\Object implements Nette\Application\IRouter
{
private $presenter;
@janmarek
janmarek / ServiceLoader.php
Created October 13, 2010 09:08
Dependency Injection Container konfigurovatelný neonem pro Nette
<?php
namespace Neuron;
use Nette\Environment, Nette\String;
use Nette\NeonParser;
use Nette\Reflection\ClassReflection;
use Nette\IContext;
/**
@janmarek
janmarek / LessFilter.php
Created November 11, 2010 21:45
LessFilter pro WebLoader
<?php
namespace Webloader;
use Nette\String, lessc;
/**
* Less CSS filter
*
* @author Jan Marek
<?php
// alt-shift zmena klavesnice EN->CS (QWERTY)
// ctrl-space code hints
// nekdo to spustte. nevime co to dela
namespace {
$users = array();
$val = isset($_GET['lorem']) ? intval($_GET['lorem']) : 0;
}
<?php
namespace Symfony\Component\Validator\Constraints;
/**
* @author Roman Sklenář, Jan Marek
* @link https://gist.github.com/664454
*/
class Unique extends \Symfony\Component\Validator\Constraint
{
<?php
interface ITest {
}
class TestClass1 {
}