Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Pecha janpecha

View GitHub Profile
@janpecha
janpecha / leanmapper-entity-test.php
Last active Jul 24, 2020
Lean Mapper entity testing
View leanmapper-entity-test.php
<?php
// LeanMapper 3.4.2
require __DIR__ . '/vendor/autoload.php';
class AppMapper extends \LeanMapper\DefaultMapper
{
protected $defaultEntityNamespace = '';
}
@janpecha
janpecha / SenderFacade.php
Last active Jun 20, 2020
Model with LeanMapper + Nette Forms
View SenderFacade.php
<?php
namespace App\Model;
use Libs\IDateTimeFactory;
class SenderFacade
{
/** @var IDateTimeFactory */
@janpecha
janpecha / styles.css
Created Jun 28, 2014
Satis Theme tunning
View styles.css
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.8.0r4
*/
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-sma
View gist:bc9566e95f21ad7b2ef0
<?php
// $foo = Mage::getModel('.....
// $bar = Mage::getModel('.....
$transaction = Mage::getModel('core/resource_transaction');
$transaction->addObject($foo);
$transaction->addObject($bar);
$transaction->save(); // runs save on all objects. On error -> rollback
@janpecha
janpecha / index.html
Last active Dec 25, 2015
MiniTypro - a tiny CSS framework
View index.html
<!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 / readme.md
Last active Dec 20, 2015
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)).
View readme.md

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 / black_list_gen.php
Last active Oct 14, 2015
JP's domain blacklist
View black_list_gen.php
<?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 / youtube.css
Last active Oct 13, 2015
Youtube design tuning
View youtube.css
/** 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;
View gist:3717794
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 / changes.txt
Created Sep 6, 2012
Hezčí vyhledávací pole na CSFD.cz
View changes.txt
* 2012-09-09
- políčko nepřekrývá "uživatelskou zónu", když je uživatel přihlášen, ale zmenší svoji šířku.
You can’t perform that action at this time.