Skip to content

Instantly share code, notes, and snippets.

Existuje třída HtmlNode, od které dědí třídy HtmlElement a HtmlTextNode.

Takže např. následující HTML kód

<div>
    First text
    <strong>Foo</strong>
    Second text
</div>
<?php
class Foo
{
public function bar(self $foo)
{
}
}
@JanTvrdik
JanTvrdik / main.cpp
Created October 12, 2012 16:46
Stable selection sort implementation for linked list
#include <iostream>
#include <cstring>
using namespace std;
template <class T>
struct Node
{
T val; // stored value
int order; // original order
@JanTvrdik
JanTvrdik / returning.html
Created December 4, 2012 11:04 — forked from tajo/returning
Return to the position before expanding
<script>
/**
* @author Chamurappi
* @param {DOMElement} element
* @return {function()} callback for restoring saved position
*/
function savePosition(element)
{
if (!element.getBoundingClientRect) return function(){};
var top = element.getBoundingClientRect().top;
#!/bin/sh
read oldrev newrev refname
branch=${refname##refs/heads/}
if [[ $branch = "master" || $branch = "stage" ]]
then
echo "Deploying branch $branch..."
targetDir="$PWD/../deployed-$branch"
<?php
class Buffer
{
public $data = '';
public $end = FALSE;
}
class Loop
{
public $readStreams = [];
{
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"default_line_ending": "unix",
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "Central European (Windows 1250)",
"font_face": "Consolas",
"font_size": 12,
@JanTvrdik
JanTvrdik / Dumper.php
Last active August 29, 2015 13:58
JSOND - JSON compatibility test
<?php
/**
* This file is part of the Tracy (http://tracy.nette.org)
* Copyright (c) 2004 David Grudl (http://davidgrudl.com)
*/
namespace Tracy;
use Tracy;
<?php
function createParagraphs($html)
{
$html = '<meta http-equiv="content-type" content="text/html;charset=utf-8"><body>' . $html;
$document = new DOMDocument();
$document->loadHTML($html);
$body = $document->getElementsByTagName('body')->item(0);
$inlineTags = ['a', 'b', 'del', 'em', 'i', 'img', 'ins', 'small', 'span', 'strong'];
$create = TRUE;
@JanTvrdik
JanTvrdik / bench.md
Created October 26, 2014 16:31
StaticRouter benchmark

Benchmark for Nextras\StaticRouter

Source code

Test __construct:
  StaticRouter                21 ms         +0 %
  Route + RouteList         1392 ms      +6529 %
 Route + global filter 244 ms +1062 %