This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {block detail} | |
| spolecny form | |
| {/block} | |
| {block content} | |
| {include detail} | |
| {/block} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * truncate text | |
| * @param string $text source | |
| * @param int $length length | |
| * @param string $suffix append | |
| * @param bool $force exactly | |
| * @return string | |
| */ | |
| function truncate($text, $length, $suffix = '', $force = false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| request = new XMLHttpRequest() | |
| request.onreadystatechange = ()-> | |
| if request.readyState == 4 && request.status == 200 | |
| console.log request.responseText | |
| return | |
| request.open "GET", url , true | |
| request.send() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Nette\Application\UI\Control; | |
| class ArticleControl extends Control{ | |
| protected $model; | |
| public function __construct(MyModel $model){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###* | |
| * dynamic element builder | |
| * @param {string} name element name, e.g "a" | |
| * @param {Object} params attributes | |
| * @return {Object} element | |
| ### | |
| buildElement: (name, params = {}) -> | |
| elem = document.createElement(name) | |
| for key, value of params | |
| elem.setAttribute key, value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $file1 = 'soubor1.txt'; | |
| $file2 = 'soubor2.txt'; | |
| // porovnani veliksoti souboru | |
| if(filesize($file1) == filesize($file2)){ | |
| echo 'jsou stejne'; | |
| } else { | |
| echo 'nejsou stejne'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function __autoload($class_name) { | |
| $filename = __DIR__.DIRECTORY_SEPARATOR.strtolower($class_name).'.php'; | |
| if(is_readable($filename)) | |
| require ($filename); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # MySQL Server Instance Configuration File | |
| # ---------------------------------------------------------------------- | |
| # Generated by the MySQL Server Instance Configuration Wizard | |
| # | |
| # | |
| # Installation Instructions | |
| # ---------------------------------------------------------------------- | |
| # | |
| # On Linux you can copy this file to /etc/my.cnf to set global options, | |
| # mysql-data-dir/my.cnf to set server-specific options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function trojuhelnik($a, $b, $c){ | |
| $arr = func_get_args(); // array($a, $b, $c); | |
| sort($arr); | |
| if(($arr[0] <= 0) || ($arr[0] + $arr[1] <= $arr[2])) | |
| throw new Exception("Trojuhelnik neni mozne sestrojit"); | |
| $arr = array_unique($arr); | |
| $result = array("rovnostranny","rovnoramenny","obecny"); | |
| return $result[count($arr)-1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function makeLink($text){ | |
| $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; | |
| preg_match_all($reg_exUrl, $text, $url); | |
| foreach ($url[0] as $key => $value) { | |
| $text = strtr($text, array($value => '<a href="'.$value.'" target="_blank">'.$value.'</a>')); | |
| } | |
| return $text; | |
| } |