Skip to content

Instantly share code, notes, and snippets.

View VladaHejda's full-sized avatar

Vladislav Hejda VladaHejda

  • Slevomat
  • Czech republic
  • X @hejdav
View GitHub Profile
@VladaHejda
VladaHejda / explorer-hledat-googlem-nastaveni.txt
Last active March 13, 2019 12:29
Nastavení vyhledávání přes Google v Internet Exploreru
Internet Explorer: nastavení vyhledávání přes Google:
1.
-> nastavení (ozubený kolečko)
-> "Spravovat doplňky"
-> "Poskytovatelé vyhledávání"
2. pokud tam je "Google" tak tenhle bod přeskočit
-> "Vhyledat další poskytovatele hledání..."
-> najít "Google Search"
@VladaHejda
VladaHejda / turtle.py
Last active November 8, 2018 18:16
turtle.py
from turtle import forward, left, right, exitonclick
for i in range(6):
for j in range(7):
forward(40)
left(60)
right(120)
exitonclick()
@VladaHejda
VladaHejda / pati-stranka.html
Last active August 22, 2018 08:40
Páti stránka - nástřel
<html>
<head>
<title>Moje stránky</title>
<style>
.moje-menu {
display: flex;
justify-content: space-around;
}
.muj-obsah {
@VladaHejda
VladaHejda / moneyphp.php
Last active October 9, 2017 13:51
MoneyPHP poor rounding :-\
<?php
$item1 = 99;
$item2 = 199;
$item3 = 57;
$credits = 355;
$profit = new \Money\Money($total, new \Money\Currency(''));
list($discount1, $discount2, $discount3) = $profit->allocate([
@VladaHejda
VladaHejda / hello_kitty.php
Created June 12, 2017 23:45
učíme se s Hello Kitty :-D
<?php
error_reporting(E_ALL & ~E_NOTICE);
$jmeno = htmlspecialchars($_GET['jmeno']);
if (!$jmeno) {
$jmeno = 'Kitty';
}
$r = rand(0, 255);
@VladaHejda
VladaHejda / redirect.sql
Created May 30, 2017 13:08
redirect zeme -> oblast
INSERT INTO redirects SET type = 3, `from` = 'filtry\\[zeme\\]', `to` = 'filtry[oblast]', created = NOW();
<?php declare(strict_types = 1);
namespace Slevomat\Number;
class NumberToWordTranslator extends \Consistence\Object
{
public function translate(int $number): string
{
$word = $this->translateSpecial($number);
@VladaHejda
VladaHejda / cell.php
Created February 5, 2016 11:27
1-D cellular automat. Call as cell.php <rule 0-255 or "loop"> <initial 64bit signed int>
<?php
$rule = $argv[1] ?? null;
$initial = $argv[2] ?? null;
$cellsCount = 64;
$loop = false;
$loopSteps = 50;
function randInitial($cellsCount) {
@VladaHejda
VladaHejda / realpathi.php
Last active July 3, 2018 03:55
PHP case-insensitive realpath()
<?php
/**
* Case-insensitive realpath()
* @param string $path
* @return string|false
*/
function realpathi($path)
{
$me = __METHOD__;
@VladaHejda
VladaHejda / LazyDataMapperCache.php
Created June 2, 2014 12:55
LazyDataMapper Nette compiler extension.
<?php
namespace LazyDataMapper;
use Nette\Caching\IStorage;
use Nette\Caching\Cache as NetteCache;
class Cache implements IExternalCache
{