Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Pecha janpecha

View GitHub Profile
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 / 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
@janpecha
janpecha / adminer.css
Created Jul 2, 2012
Adminer Skin (based on default Nette Adminer skin)
View adminer.css
/* CSS by Brade - www.bradezone.com */
/* Icons by Hever [hev.cz] - June 2009, ver 0.1.3 */
/* Used icons: Silk icon set 1.3 by Mark James --- http://www.famfamfam.com/lab/icons/silk/ */
/* modified by davidgrudl */
/* modified by Jan Pecha, <janpecha@email.cz>, 2012-09-16 */
body {
background: #FFF;
color: #333;
@janpecha
janpecha / style.css
Created Jul 23, 2012
Piratskenoviny.cz Better Style
View style.css
@import url('typro.css');
body {
border-top: 6px solid #222;
padding-bottom: 3em;
}
body * {
font-family: inherit !important;
font-size: inherit !important;
@janpecha
janpecha / ytdl
Created Aug 23, 2012
Shortcut for youtube-dl
View ytdl
#!/bin/bash
# saves the path to this script's directory
dir=` dirname $0 `
# absolutizes the path if necessary
if echo $dir | grep -v ^/ > /dev/null; then
dir=` pwd `/$dir
fi
@janpecha
janpecha / .htaccess
Last active Oct 9, 2015
Dynamické subdomény pomocí .htaccess
View .htaccess
### Source code moved to https://github.com/janpecha/htaccess-subdomains/ ###
## Custom Error Pages
#ErrorDocument 404 /errors/e404.html
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>
Options -Indexes
@janpecha
janpecha / nakn.js
Last active Oct 9, 2015
Vylepšení formuláře pro zadání čísla parcely na nahlizenidokn.cuzk.cz - automaticky přejde na další políčko při stisknutí lomítka. ZATÍM JEN PRO OPERU.
View nakn.js
/** Vylepseni formulare na Nahlizeni do katastru nemovistosti
*
* @author Jan Pecha, <janpecha@email.cz>
* @version 2013-08-12-2
* @license New BSD License
*/
function nah_SelectAreaFormHelper()
{
var el = document.getElementById('ctl00_bodyPlaceHolder_txtParcis');
@janpecha
janpecha / convert2mp3
Created Sep 2, 2012
Converting media files to MP3. Vyžaduje `ffmpeg`.
View convert2mp3
#!/bin/bash
# saves the path to this script's directory
dir=` dirname $0 `
# absolutizes the path if necessary
if echo $dir | grep -v ^/ > /dev/null; then
dir=` pwd `/$dir
fi
@janpecha
janpecha / Nette Action Method
Created Sep 5, 2012
Gedit3 Snippets for Nette Framework
View Nette Action Method
public function action${1:Default}()
{
$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.