Skip to content

Instantly share code, notes, and snippets.

View Kcko's full-sized avatar
🦜
fly like a bird ...

Roman Janko Kcko

🦜
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / fn.js
Created February 19, 2015 20:21
HTML v IE 8, klasické i vlastní značky jako elementy
<!--[if lte IE 8]>
<script>
var znacky = "article aside audio bb canvas datagrid datalist details dialog eventsource figure footer header hgroup mark menu meter nav output progress section time video";
znacky.replace(/\w+/g, function(znacka){document.createElement(znacka)});
</script>
<![endif]-->
@Kcko
Kcko / ordered-list-2-selectbox.js
Created February 19, 2015 20:27
HTML seznam do selectboxu (např. pro responsivní navigaci)
$(function(){
var select = $("select");
$("nav a").each(function(){
var $this = $(this);
var text = $this.text();
var level = $this.parents("ul").length;
var indent = '';
if (level > 1)
@Kcko
Kcko / Odeslani-emailu-s-prilohou-z-formulate.php
Last active August 29, 2015 14:16
Odeslání přílohy z formuláře
<?
$mail->addAttachment($values['priloha'])->setHeader('Content-Disposition', 'attachment; filename='.$values['priloha']->getName());
?>
@Kcko
Kcko / form.latte
Last active August 29, 2015 14:16 — forked from martiman/form.latte
<form n:name=$form class="form">
<div class="row">
<div class="col-md-12">
<ul class=error n:if="$form->ownErrors">
<li n:foreach="$form->ownErrors as $error">{$error}</li>
</ul>
</div>
</div>
<div class="row">
{foreach $form->controls as $input}
@Kcko
Kcko / vertical-centering.css
Created March 3, 2015 08:42
Vertical centering IE 9 or 10+
.parent-element {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
/* Calendar - step 3
---------------------------------------------------------------------------------------------------- */
function Calendar(el)
{
this.el = $(el);
this.header = $('thead', this.el);
this.body = $('tbody', this.el);
@Kcko
Kcko / component.php
Last active May 6, 2021 20:04
Nette rendering - containers (form)
<?
public function createComponentRatingForm()
{
$form = new Nette\Application\UI\Form;
$form->setTranslator($this->translator);
$messages = array(
@Kcko
Kcko / error.latte
Last active April 12, 2016 17:26
Nette form - vykreslení chyb
<!-- Jednoduché vykreslení chyb -->
<div class="error-message" n:if="$form->hasErrors()">
<div n:foreach="$form->errors as $error">{$error}</div>
</div>
{control $form errors}
@Kcko
Kcko / nette-routing.php
Created March 18, 2015 14:21
Nette - routování - překladová tabulka
<?php
$router[] = new Route('<presenter galerie|blog|novinky|ubytovani>/<action>[/<id>]', array(
'presenter' => array(
Route::FILTER_TABLE => array(
// řetězec v URL => presenter
'galerie' => 'Gallery',
'blog' => 'Blog',
'novinky' => 'News',
@Kcko
Kcko / resize-timeout.js
Created March 26, 2015 17:45
Resize window with timeout (for responsive testing)
var a;
$(window).resize(function(){
clearTimeout(a);
a = setTimeout(function(){
// call your function
},750);
});