Skip to content

Instantly share code, notes, and snippets.

View VisibilityHack.php
<?php
/**
* Tools for accessing "invisible" properties and calling "invisible" methods
*
* @author Jan Tvrdík
* @license MIT
*/
class VisibilityHack
{
/**
@JanTvrdik
JanTvrdik / FormMacros.php
Created Jun 12, 2010 — forked from janmarek/FormMacros.php
Macros for manual form rendering in Nette Framework
View FormMacros.php
<?php
namespace Nette\Templates;
use Nette;
use Nette\String;
use Nette\Forms\Form;
/**
* Form macros
*
View DatePicker.php
<?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
{
View ReplicatingContainer.php
<?php
/**
* Magický, komponenty na požádání tvořící kontejner
*
* @author Jan Tvrdík
*/
class ReplicatingContainer extends Nette\ComponentContainer
{
/** @var callback */
public $factoryCallback;
View git-remove-diacritics.sh
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" \
View pipe.php
<?php
class Foo
{
/**
* @return Foo|int|NULL|TRUE|FALSE|bool
*/
public function test()
{
}
View whereCalled.php
<?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 Jun 14, 2011
Nette Framework Forum – User CSS
View nette-forum.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 {
View export.sql
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,
View main.c
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char c = ' '; // aktuálně čtený znak
int negative;
int result;
int sum = 0;