Skip to content

Instantly share code, notes, and snippets.

View PavelJurasek's full-sized avatar

Pavel Jurásek PavelJurasek

View GitHub Profile
@ondrejmirtes
ondrejmirtes / ConsoleDebug.php
Created March 18, 2011 12:44
PHP Nette CLI comfortable debugging
<?php
namespace Tools;
use Nette\Debug;
use Nette\Environment;
use Nette\Finder;
/**
* Shows exceptions thrown in CLI mode in browser.
@Aurielle
Aurielle / whatever.php
Created February 11, 2012 16:13
Nekonečně hluboké zanoření - routy
<?php
$catFilterIn = function($slug, $params, $origParams) use($site) {
if(!isset($site->languages[$params['lang']]))
return NULL;
$lang = $site->languages[$params['lang']];
$temp = explode('/', trim($slug, '/'));
$path = array();
$slugs = array();
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
<?php
interface INavigationLoader
{
/** @return Nette\ArrayHash */
function loadNavigation();
}
@fprochazka
fprochazka / BasePresenter.php
Created October 6, 2012 16:22
Image pipe for #nettefw templates
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
<?php
/**
* This file is part of the Kdyby (http://www.kdyby.org)
*
* Copyright (c) 2008, 2012 Filip Procházka (filip@prochazka.su)
*
* For the full copyright and license information, please view the file license.txt that was distributed with this source code.
*/
@enumag
enumag / bardump.php
Created December 11, 2012 22:28
Nette\Diagnostics\Debugger::barDump shortcut
<?php
use \Nette\Diagnostics\Debugger;
/**
* Nette\Diagnostics\Debugger::barDump shortcut.
* @author Jáchym Toušek
* @param mixed $value
*/
function bd($value)
anonymous
anonymous / BasePresenter.php
Created January 7, 2013 01:36
<?php
/**
* Base presenter for all application presenters.
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Doctrine\ORM\EntityManager
<?php
namespace App;
class UserStorage extends \Nette\Http\UserStorage
{
/** Log-out reason */
const IDENTITY_CHANGED = 16;
@vrana
vrana / AnyKeyArray.php
Last active December 17, 2015 08:39
Array-like object allowing any serializable keys
<?php
class AnyKeyArray implements ArrayAccess, Iterator, Countable {
private $values = array();
// ArrayAccess
function offsetSet($key, $value) {
$this->values[serialize($key)] = $value;
}