Skip to content

Instantly share code, notes, and snippets.

View pikl-cz's full-sized avatar

Jan Pikl pikl-cz

View GitHub Profile
server {
listen 80;
server_name premonstrati2021.cz www.premonstrati2021.cz;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
build: {
files: {
'<%= pkg.destFolder %>/css/main.css': '<%= pkg.srcFolder %>/css/main.less',
@pikl-cz
pikl-cz / cookies.htm
Last active March 24, 2022 07:54
Simple cookie lišta
<!-- Prohlášení o cookies -->
<style>
#eu-cookies {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
color: white;
background-color: darkblue;
z-index: 1000;
@pikl-cz
pikl-cz / 1or2filledvalidnette
Last active August 2, 2017 14:38
budtoneboto validace nette form
$input1
->setType("number")
->addCondition(\Nette\Application\UI\Form::FILLED)
->addRule(\Nette\Application\UI\Form::NUMERIC, "%label musí být číselná hodnota")
->endCondition()
->addConditionOn($input2, \Nette\Application\UI\Form::BLANK)
->addRule(\Nette\Application\UI\Form::FILLED, 'Povinný')
->endCondition();
$input2
->setType("number")
<?php
namespace App;
use Nette;
use Nette\Application\Routers\RouteList;
use Nette\Application\Routers\Route;
use Nette\Application\Routers\CliRouter;
class RouterFactory {
$qb= $this->em->getRepository(DCE::class)->createQueryBuilder();
$qb->select('dce')
->addSelect("COUNT(dc) amount")
->from($this->entityPath, 'dce')
->join('dce.discount_coupons', 'dc');
if (!empty($filter)) {
if (isset($filter['title']) && !empty($filter['title'])) {
$qb->andWhere('dce.title LIKE :title')
@pikl-cz
pikl-cz / bootstrap.php
Created May 18, 2017 11:04
Testování presenteru
<?php
require __DIR__ . '/../../vendor/autoload.php';
Tester\Environment::setup();
$configurator = new Nette\Configurator;
$configurator->addParameters([
'appDir' => __DIR__ . '/../../app',
]);
<?php
namespace FlexiAuth;
use Nette\Security as NS;
class Authenticator implements \FlexiAuth\IAuthenticator {
/*
* Where user can go