Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Tools for accessing "invisible" properties and calling "invisible" methods
*
* @author Jan Tvrdík
* @license MIT
*/
class VisibilityHack
{
/**
@JanTvrdik
JanTvrdik / FormMacros.php
Created June 12, 2010 10:49 — forked from janmarek/FormMacros.php
Macros for manual form rendering in Nette Framework
<?php
namespace Nette\Templates;
use Nette;
use Nette\String;
use Nette\Forms\Form;
/**
* Form macros
*
<?php
/**
* Form control for selecting date
*
* Internally holds date as DateTime instance which is also returned by getValue method
*
* @author Jan Tvrdík
*/
class DatePicker extends Nette\Forms\FormControl
{
@JanTvrdik
JanTvrdik / ReplicatingContainer.php
Created August 19, 2010 13:13
ReplicatingContainer
<?php
/**
* Magický, komponenty na požádání tvořící kontejner
*
* @author Jan Tvrdík
*/
class ReplicatingContainer extends Nette\ComponentContainer
{
/** @var callback */
public $factoryCallback;
git filter-branch -f --msg-filter '
sed \
-e "s/\xC4\x9B/e/g" \
-e "s/\xC5\xA1/s/g" \
-e "s/\xC4\x8D/c/g" \
-e "s/\xC5\x99/r/g" \
-e "s/\xC5\xBE/z/g" \
-e "s/\xC3\xBD/y/g" \
-e "s/\xC3\xA1/a/g" \
-e "s/\xC3\xAD/i/g" \
<?php
class Foo
{
/**
* @return Foo|int|NULL|TRUE|FALSE|bool
*/
public function test()
{
}
<?php
function wc($level = 1) {
if (\Nette\Debug::$productionMode) { return; }
$o = function ($t) { return (isset($t->class) ? htmlspecialchars($t->class) . "->" : NULL) . htmlspecialchars($t->function) . '()'; };
$f = function ($t) {
$file = defined('APP_DIR') ? 'app' . str_replace(realpath(APP_DIR), '', realpath($t->file)) : $t->file;
return '<a href="' . \Nette\DebugHelpers::editorLink($t->file, $t->line) . '">' . htmlspecialchars($file) . ':' . (int)$t->line . '</a>';
};
@JanTvrdik
JanTvrdik / nette-forum.css
Created June 14, 2011 00:28
Nette Framework Forum – User CSS
#punwrap {max-width: 1200px; width: auto !important;}
blockquote p {
margin: 5px 0 !important; padding: 0 !important;
font-family: Verdana !important;
font-size: 12px !important;
}
blockquote p:first-child {
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `articles`
-- ----------------------------
DROP TABLE IF EXISTS `articles`;
CREATE TABLE `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char c = ' '; // aktuálně čtený znak
int negative;
int result;
int sum = 0;