Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@Kedrigern
Kedrigern / prvocisla.pas
Created October 21, 2012 17:21
Prvočísla (test, eratoshenovo síto) v Pascalu....
{Author: Ondřej Profant, 2009}
unit prvocisla;
interface
Const MaxN = 10000; // konec Eratosthenova Síta
Type SITO = array [2..MaxN] of boolean;
function Prvocislo(j: integer): boolean;
@Kedrigern
Kedrigern / zapliner.pas
Created October 21, 2012 16:35
Převod čísel na slovní vyjádření a obráceně.
{
# Copyright 2008 Ondřej "Kedrigern" Profant < ondrej.profant (*) gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Kedrigern
Kedrigern / model.php
Created October 31, 2012 16:53
OOP model dodavatele v eshopu
<?php
namespace test;
class objednavkaDopravaInfo
{
public $kg;
public $psc;
public $typ;
public $dostupnost; // dostupnost u nas
@Kedrigern
Kedrigern / finace.php
Created November 1, 2012 18:20
Náčrt vypořádání se s různými měnami a s operacemi vzniklými z toho
<?php
/**
* Author: Ondřej Profant, 2012
*/
namespace finance;
/**
* Náhrada za výčtový typ.
* Definuje konstanty pro jednotlivé měny.
@Kedrigern
Kedrigern / kombinatorika.cs
Created December 18, 2012 10:23
Základy kombinatoriky implementované v C#. Dole je readme.
using System;
namespace kombinatorika
{
class MainClass
{
public static void Main (string[] args)
{
Console.Write ("Hello World!\nPočet hodnot (jazyk): ");
int n = 4;//int.Parse( Console.ReadLine() );
@Kedrigern
Kedrigern / HomepagePresenter.php
Created January 29, 2013 16:38
Hrátky s form replikátorem z Nette
/*
* Tento příklad vychází z Sandbox z http://addons.nette.org/cs/form-container-replicator
* resp. správně nastavené rozlišení form replikator
*/
<?php
use Nette\Forms\Container;
use Nette\Application\UI\Form;
/**
@Kedrigern
Kedrigern / NumberMatching.php
Last active December 16, 2015 11:48
Regexp matchich if string with street name has orientation number too.
<?php
/**
*
* Regexp matchich if string with street name has orientation number too.
* Rules are for Czech Republic orientation numbers:
* a) number for 0-999
* b) may be supplemented by one letter
* @link http://www.czso.cz/csu/rso.nsf/i/cislo_orientacni
*
@Kedrigern
Kedrigern / mails.php
Last active December 16, 2015 12:19
Extract mail address in pointy brackets ("<", ">") from given string
<?php
/**
*
* Extract mail address in pointy brackets ("<", ">") from given string
*
* @author: Ondřej Profant <ondrej.profant <> gmail.com>, 2013
*
*/
@Kedrigern
Kedrigern / UploadManager.php
Created May 15, 2013 09:49
Implements PHP infrastructure for http://blueimp.github.io/jQuery-File-Upload in Nette FW.
<?php
use Nette\Utils\Finder;
/**
* @todo fake delete (delete to global trash)
*/
class UploadManager extends \Nette\Object
{
/** @var string upload dir */
@Kedrigern
Kedrigern / Formik.php
Created May 15, 2013 19:07
Volání submitu formuláře z jiného handle
<?php
use \Nette\Application\UI\Form;
class Formik extends Form
{
public function __construct()
{
parent::__construct();