Skip to content

Instantly share code, notes, and snippets.

/**
* @author Pavel Kalvoda
*/
abstract class BasePresenter extends Nette\Application\Presenter
{
<?php
//Horner, hovada.....
function decToBin($num) {
do {
$res[] = $rem = $num % 2;
$num = floor($num/2);
} while ($num);
return join("",array_reverse($res));
}
@PJK
PJK / cache.php
Created April 27, 2011 11:41
Reference caching test
<?php
require("class.php");
$cache = $a->a->a;
for ($i=1; $i<=$loopcount; $i++) {
$cache->a;
}
@PJK
PJK / BasePresenter.php
Created April 14, 2011 10:33
TwigMacro
<?php
public function templatePrepareFilters($template) {
$template->registerFilter($latte = new Nette\Templates\LatteFilter());
TwigMacro::register($latte->getHandler());
}
@PJK
PJK / Example.cs
Created February 3, 2011 21:15
DESF usage exaple
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DESF;
using DESF.Flow.Event;
using DESF.Flow.Calendar;
using DESF.Tools;
namespace CalendarTest