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 // regulární výraz pro tokenizaci českých číslovek v rozsahu 1 až 999.999 v prvním a druhém pádu | |
$re = "//(?<=\W)(?:(?:(?:(?:(?:(?:(?:(jed)(?:en|na|nu|né|noho|něch)|(dv)(?:a|ě|ou)|(tř)(?:i|í|ech)|(čtyř)(?:i|ech)?|(pět)i?|(šest)i?|(sedm)i?|(osm)i?|(dev)(?:ět|íti))) )?(s)(?:to|tě|ta|et|tov(?:ka|ky|ek)))? ?(?:(?:(?:(?:(?:(?:(jed)(?:en|na|nu|né|noho|něch)|(dv)(?:a|ě|ou)|(tř)(?:i|í|ech)|(čtyř)(?:i|ech)?|(pět)i?|(šest)i?|(sedm)i?|(osm)i?|(dev)(?:ět|íti))a)|(jed)na)(?:(dvacet)i?|(třicet)i?|(čtyřicet)i?|(padesát)i?|(šedesát)i?|(sedmdesát)i?|(osmdesát)i?|(devadesát)i?))|(?:(?:(dvacet)i?|(třicet)i?|(čtyřicet)i?|(padesát)i?|(šedesát)i?|(sedmdesát)i?|(osmdesát)i?|(devadesát)i?)(?: (?:(jed)(?:en|na|nu|né|noho|něch)|(dv)(?:a|ě|ou)|(tř)(?:i|í|ech)|(čtyř)(?:i|ech)?|(pět)i?|(šest)i?|(sedm)i?|(osm)i?|(dev)(?:ět|íti)))?)|(?:(?:(jedenáct)i?|(dvanáct)i?|(třináct)i?|(čtrnáct)i?|(patnáct)i?|(šestnáct)i?|(sedmnáct)i?|(osmnáct)i?|(devatenáct)i?))|(?:(?:(jed)(?:en|na|nu|né|noho|něch)|(dv)(?:a|ě|ou)|(tř)(?:i|í|ech)|(čtyř)(?:i|ec |
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 // regular expression for tokenization of english numerals from 1 to 999.999 | |
$re = "/(?<=\W)(?:(?:(?:(?:(?:(?:(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine))) )?(hundred)s?)? ?(?:and )?(?:(?:(?:(?:(twenty)|(thirty)|(forty)|(fifty)|(sixty)|(seventy)|(eighty)|(ninety))(?:[- ]?(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine)))?)|(?:(?:(eleven)|(twelve)|(thirteen)|(fourteen)|(fifteen)|(sixteen)|(seventeen)|(eighteen)|(nineteen)))|(?:(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine)))|(?:(ten))))?) )?(thousand)s?)? ?(?:(?:(?:(?:(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine))) )?(hundred)s?)? ?(?:and )?(?:(?:(?:(?:(twenty)|(thirty)|(forty)|(fifty)|(sixty)|(seventy)|(eighty)|(ninety))(?:[- ]?(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine)))?)|(?:(?:(eleven)|(twelve)|(thirteen)|(fourteen)|(fifteen)|(sixteen)|(seventeen)|(eighteen)|(nineteen)))|(?:(?:(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine)))|(?:(ten)) |
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
DROP FUNCTION IF EXISTS `GENERATE_DELETE_TRIGGER`;; | |
CREATE DEFINER=`vlasta`@`%` FUNCTION `GENERATE_DELETE_TRIGGER`(`src` varchar(128), `dst` varchar(128)) RETURNS text CHARSET utf8 | |
READS SQL DATA | |
COMMENT 'generuje kód pro vytvoření zálohovacího triggeru (AD)' | |
BEGIN | |
DECLARE src_schema, src_table, dst_schema, dst_table VARCHAR(64); | |
DECLARE output TEXT DEFAULT ''; | |
DECLARE col_name, x_schema, x_table VARCHAR(64); | |
DECLARE nullable VARCHAR(3); |
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
DROP FUNCTION IF EXISTS `GENERATE_UPDATE_TRIGGERS`;; | |
CREATE DEFINER=`vlasta`@`%` FUNCTION `GENERATE_UPDATE_TRIGGERS`(`src` varchar(130)) RETURNS text CHARSET utf8 | |
READS SQL DATA | |
COMMENT 'generuje kód pro vytvoření update triggerů (BI, BU)' | |
BEGIN | |
DECLARE src_schema, src_table VARCHAR(64); | |
DECLARE output TEXT DEFAULT ''; | |
DECLARE col_name, x_schema, x_table VARCHAR(64); | |
DECLARE nullable VARCHAR(3); |
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 | |
// test PHP funkce strftime() na Windows | |
echo '<h2>strftime()</h2>'; | |
echo '%a: ' . strftime('%a') . '<br>'; | |
echo '%A: ' . strftime('%A') . '<br>'; | |
echo '%d: ' . strftime('%d') . '<br>'; | |
echo '%e: ' . strftime('%e') . '<br>'; | |
echo '%j: ' . strftime('%j') . '<br>'; |
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
formátování <fieldset> a <legend> je opravdu vojeb. veškerá řešení, | |
která jsem našel vyžadovala přidat do kódu nějaké pomocné <div>y nebo | |
<span>y. takové řešení mi ale nevyhovuje | |
nakonec jsem dospěl k tomuto. vypadá na pixel stejně ve všech novějších | |
prohlížečích včetně IE7. v IE6 a starších (bez selektorů + a >) nefunguje | |
falešný padding |
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
sada funkcí pro skládání SQL dotazů v Excelu | |
autor: Vlasta Neubauer [@paranoiq] | |
licence: public domain | |
pro koho to je: | |
- pro každého, kdo musí ručně upravovat/importovat větší množství záznamů a nestačí mu prostředky GUI nástrojů a ručně psaného SQL | |
co to umí: | |
- jednoduše vytvářet z dat v Excelu SQL dotazy typu INSERT, UPDATE, DELETE, INSERT IGNORE, REPLACE a INSERT ON DUPLICATE KEY UPDATE |
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
/** | |
* Alternative style for Adminer. Zrobeno 7.4.2011 | |
* @author Vlasta Neubauer [@paranoiq] | |
*/ | |
/* -- fonts ----------------------------------------------------------------- */ | |
body { | |
font-size: 11pt; | |
} | |
body, select, option, optgroup, button { |
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
/** | |
* Make table body scrollable, with the table header always visible. | |
* Table shrinks vertically to fit the browser viewport. | |
* | |
* requirements: | |
* - jQuery framework required (tested with 1.6.2) | |
* - header must be wrapped in <thead> element | |
* | |
* warnings: | |
* - table <caption> is not supported |
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 | |
namespace Dogma\Database; | |
/** | |
* query(), fetch?(), exec(): | |
* New preprocesor makes dibi-like syntax possible. | |
* Question mark (?) is not required and *not allowed* in alternative syntax. | |
* eg. $db->exec("UPDATE x SET y = ", $y, "WHERE z = ", $z); |
OlderNewer