Skip to content

Instantly share code, notes, and snippets.

🎮
Working hard!

Dominik Procházka Domm98CZ

🎮
Working hard!
View GitHub Profile
View translator.php
<?php
namespace App;
use Nette;
use Tracy\Debugger;
use App\Model;
use Nette\Neon\Neon;
class Translator implements Nette\Localization\ITranslator
{
@Domm98CZ
Domm98CZ / phpRandomBasedOnTime.php
Created Oct 28, 2019
Random login screen images, based on time.
View phpRandomBasedOnTime.php
<?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 FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SET GROUP_CONCAT_MAX_LEN=32768;
SELECT GROUP_CONCAT('`', table_schema, '`.`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables, '') INTO @tables;
@Domm98CZ
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>
<component name="PhpEntryPointsManager">
<pattern value="\*\Presenters\*" member="createComponent*" />
<pattern value="\*\Presenters\*" member="handle*" />
<pattern value="\*\Presenters\*" member="action*" />
<pattern value="\*\Presenters\*" member="render*" />
View CurlFactory.php
<?php declare(strict_types=1);
namespace App;
use RuntimeException;
use Wavevision\DIServiceAnnotation\DIService;
/**
* @DIService(generateInject=true)
*
* Class cURLFactory
You can’t perform that action at this time.