Skip to content

Instantly share code, notes, and snippets.

Working hard!

Dominik Procházka Domm98CZ

Working hard!
View GitHub Profile
View translator.php
namespace App;
use Nette;
use Tracy\Debugger;
use App\Model;
use Nette\Neon\Neon;
class Translator implements Nette\Localization\ITranslator
Domm98CZ / phpRandomBasedOnTime.php
Created Oct 28, 2019
Random login screen images, based on time.
View phpRandomBasedOnTime.php
$loginImages = ['login-bg-11.jpg', 'login-bg-12.jpg', 'login-bg-13.jpg', 'login-bg-14.jpg', 'login-bg-15.jpg', 'login-bg-16.jpg', 'login-bg-17.jpg'];
$seed = srand(floor(time() / (60*60*24)));
$randomizedSeedNumber = rand(0, count($loginImages)) % 100;
$randomizedLoginImage = $loginImages[$randomizedSeedNumber]??$loginImages[0];
echo $randomizedLoginImage;
View dropDatabase.sql
use `dbName`; --your db name here
SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_schema, '`.`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables, '') INTO @tables;
Domm98CZ / misc.xml
Created Feb 8, 2020
PHPStorm Nette ignore list
View misc.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
<component name="PhpEntryPointsManager">
<pattern value="\*\Presenters\*" member="createComponent*" />
<pattern value="\*\Presenters\*" member="handle*" />
<pattern value="\*\Presenters\*" member="action*" />
<pattern value="\*\Presenters\*" member="render*" />
View CurlService.php
<?php declare(strict_types=1);
namespace CurlService;
use RuntimeException;
* Class CurlService
* @package CurlService
class CurlService
Domm98CZ / .htaccess
Created Mar 21, 2021
wedos domain htaccess
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME} [L,R=301]
Domm98CZ / .htaccess
Last active Mar 21, 2021
wedos main htaccess
View .htaccess
RewriteEngine On
ErrorDocument 500 "500 - Vnitrni chyba!"
ErrorDocument 404 "404 - Stranka nenalezena!"
ErrorDocument 401 "Litujeme, ale nemate pravo k pristupu k tomuto souboru!"
ErrorDocument 403 "Litujeme, ale nemate pravo k pristupu k tomuto souboru!"
# cele domeny (aliasy)
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
Domm98CZ / randomCzechNameBySeed.php
Last active Apr 12, 2021
Náhodné české jméno založené na seedu
View randomCzechNameBySeed.php
class xyz
* @param string $seed
* @return string
Domm98CZ / index.php
Created May 22, 2021
PHP Helper files
View index.php
if(!empty($_GET["t"]) && isset($_GET["t"]) && is_numeric($_GET["t"])) {
echo "<strong>Datum:</strong> <pre>".date("d. m. Y H:i:s", $_GET["t"])."</pre>";
echo "<hr>";
echo "<strong>Timestamp:</strong> <pre>".time()."</pre>";
echo "<hr>";
echo "<strong>_SERVER:</strong> <pre>";
echo "</pre>";