Skip to content

Instantly share code, notes, and snippets.

@janpecha
janpecha / gist:3717794
Created September 13, 2012 21:25
Piškvorky :)
Private Sub Form_Load()
' Naberem promenne
xxx = False
'' Naplneni pomocnych poli
relX(0) = 1
relX(1) = 1
relX(2) = 0
relX(3) = -1
'---
relY(0) = 0
@janpecha
janpecha / youtube.css
Last active October 13, 2015 17:58
Youtube design tuning
/** Youtube Tuning CSS
* @author Jan Pecha, 2012-2013
* @license New BSD License
* @version 2013-08-16-1
*/
/*player-width player-height*/
/* Zarovnani na stred */
#yt-masthead, #page-container, #alerts, #footer-hh, #masthead-subnav, #content-container {
width: 1124px !important;
margin: 0 auto !important;
@janpecha
janpecha / black_list_gen.php
Last active October 14, 2015 02:18
JP's domain blacklist
<?php
/** BlackList Generator from domain list
*
* @author Jan Pecha, <janpecha@email.cz>
* @version 2013-01-26-1
*/
$content = file($_SERVER['argv'][1]);
$domains = array();
@janpecha
janpecha / readme.md
Last active December 20, 2015 22:28
Závislé scrollbary u HTML elementů - když se vertikálně scroluje s jedním, zároveň se automaticky scroluje i v druhém (samozřejmě v poměru vzhledem k výšce (obsahu)).

Závislé scrollbary u HTML elementů - když se vertikálně scroluje s jedním, zároveň se automaticky scroluje i v druhém (samozřejmě v poměru vzhledem k výšce (obsahu)).

Pro fungující navázání event handlerů v příkladu vyžaduje mini-JS-knihovnu Jasno (https://github.com/janpecha/jasno). Lze nahradit voláním addEventListener() (v Opeře, FF, Chrome,... ne v IE).

Live demo: http://janpecha.iunas.cz/demos/scrollbars/

@janpecha
janpecha / index.html
Last active December 25, 2015 10:49
MiniTypro - a tiny CSS framework
<!DOCTYPE html>
<html lang="cs">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="minitypro.css">
<title>MiniTypro - basic example</title>
</head>
<body>
@janpecha
janpecha / SenderFacade.php
Last active June 20, 2020 08:19
Model with LeanMapper + Nette Forms
<?php
namespace App\Model;
use Libs\IDateTimeFactory;
class SenderFacade
{
/** @var IDateTimeFactory */
@janpecha
janpecha / leanmapper-entity-test.php
Last active July 24, 2020 09:56
Lean Mapper entity testing
<?php
// LeanMapper 3.4.2
require __DIR__ . '/vendor/autoload.php';
class AppMapper extends \LeanMapper\DefaultMapper
{
protected $defaultEntityNamespace = '';
}
@janpecha
janpecha / verifyIC.php
Created February 16, 2023 06:16 — forked from dg/verifyIC.php
Ověření rodného čísla a IČ
<?php
function verifyIC($ic)
{
// be liberal in what you receive
$ic = preg_replace('#\s+#', '', $ic);
// má požadovaný tvar?
if (!preg_match('#^\d{8}$#', $ic)) {
return FALSE;