Skip to content

Instantly share code, notes, and snippets.

/* My customization */
code {
font: 12px/20px Consolas, monospace;
}
#menu {
position: absolute;
bottom: auto;
}
public static function renderSnippets($control, $local, $params)
{
$control->snippetMode = FALSE;
$payload = $control->getPresenter()->getPayload();
if (isset($local->blocks)) {
foreach ($local->blocks as $name => $function) {
if ($name[0] !== '_' || !$control->isControlInvalid(substr($name, 1))) {
continue;
}
@JanTvrdik
JanTvrdik / BasePresenter.php
Created January 2, 2012 10:20 — forked from hrach/BasePresenter.php
Secured signlas - old NETTE!
<?php
/**
* Signály.cz – JP2
* ----------------
*
* @license MIT License http://en.wikipedia.org/wiki/MIT_License
* @link http://signaly.cz
*/
use Nette;
@JanTvrdik
JanTvrdik / scrum-do.js
Created November 25, 2011 18:42
ScrumDo Workaround for missing features
var initStory = function (block) {
var storyId = block.attr('story_id');
var commentBoxId = 'story_comments_' + storyId;
var commentBox = block.find('#' + commentBoxId);
if (commentBox.length > 0) {
initComments(commentBox);
} else {
// Odkaz na zobrazení komentářů
@JanTvrdik
JanTvrdik / undia
Created November 8, 2011 19:14
Git Bash pager, který odstraní diakritiku
#!/bin/bash
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" \
@JanTvrdik
JanTvrdik / check-io.sh
Created October 23, 2011 12:46
ProgTest test tool
#!/bin/bash
if [[ $1 = "" || $2 = "" ]]
then
echo "Chybí povinné parametry"
echo "check-io <programPath> <samplesDir>"
exit 1
fi
pg="$1"
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char c = ' '; // aktuálně čtený znak
int negative;
int result;
int sum = 0;
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,
@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 {
<?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>';
};