Skip to content

Instantly share code, notes, and snippets.

🚀
Building CI service for @rectorphp

Jan Mikeš JanMikes

🚀
Building CI service for @rectorphp
Block or report user

Report or block JanMikes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JanMikes
JanMikes / script.php
Created May 17, 2019
PHP - Replace all classes as strings usages in project
View script.php
#!/usr/bin/php
<?php declare(strict_types=1);
use Nette\Loaders\RobotLoader;
use Nette\Utils\FileSystem as NetteFileSystem;
use Nette\Utils\Finder;
use Nette\Utils\Strings;
require __DIR__ . '/../vendor/autoload.php';
@JanMikes
JanMikes / Dockerfile
Created Sep 15, 2018
Multi-stage dockerfile with xdebug for local development
View Dockerfile
####
## Production build
####
FROM php:7.1-apache as production
MAINTAINER Jan Mikeš j.mikes@me.com
## Install composer globally
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer
@JanMikes
JanMikes / CreateTicketPresenter.php
Created Dec 3, 2017
Creating DTO from request body (dumb way!)
View CreateTicketPresenter.php
<?php declare (strict_types=1);
namespace OdbavTo\App\Presenters;
use Nette\Application\IResponse;
use Nette\Application\Request;
use OdbavTo\App\HttpRequest\RequestBodyHelper;
use OdbavTo\App\Responses\CreatedResponse;
use OdbavTo\Application\CreateTicket\CreateTicketRequest;
use OdbavTo\Application\CreateTicket\CreateTicketUseCase;
View Build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="OdbavTo" default="createLocalConfig" basedir=".">
<property environment="env" />
<property name="configFile" value="app/config/config.local.neon" />
<target name="createLocalConfig" description="Creates local config file">
<available file="${configFile}" property="configExists" />
<if>
<isset property="configExists" />
<then>
@JanMikes
JanMikes / DB.txt
Last active Sep 22, 2017
Example of simple and stupid value object
View DB.txt
Vygenerovat migrations, ktera smaze z commentu typu `(DC2Type:identity_uid)`
@JanMikes
JanMikes / run-rabbit-consumers.php
Created Sep 7, 2017
Multiple rabbit consumers in single command
View run-rabbit-consumers.php
<?php declare(ticks=1, strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';
use Arara\Process\Action\Command;
use Arara\Process\Child;
use Arara\Process\Control;
use Kdyby\RabbitMq\DI\RabbitMqExtension;
use Nette\DI\Container;
@JanMikes
JanMikes / build.xml
Last active Jul 12, 2017
First Phing build script
View build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="OdbavTo" default="production" basedir=".">
<property environment="env" />
<property name="configFile" value="app/config/config.testttt.neon" />
<target name="production" description="Creates local config file">
<available file="${configFile}" property="configExists" />
<echo msg="Config file: ${configFile}" />
<echo msg="Config exists: ${configExists}" />
<if>
View gist:9958af45b71da4848b649873ac7138a0
root@debian7:~# ./certbot-auto certonly --webroot -w /var/www/cz.directa.com/www -d cz.directa.com -d cs.directa.com -d ru.directa.com
Bootstrapping dependencies for Debian-based OSes...
Hit:1 http://packages.dotdeb.org wheezy-php56 InRelease
Hit:2 http://security.debian.org stretch/updates InRelease
Hit:3 http://ftp.u-picardie.fr/mirror/debian wheezy-backports InRelease
Hit:4 http://ftp.it.debian.org/debian stretch InRelease
Hit:5 http://ftp.it.debian.org/debian stretch-proposed-updates InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
@JanMikes
JanMikes / Article1.php
Last active Nov 28, 2016
Draft of possible immutable append-only entities
View Article1.php
<?php
class Article
{
/** @var \DateTime */
private $createdAt;
/** @var ArticleHistory[] */
private $historyChanges;
View gist:97c7d77594a7fa0eb0ae
var didScroll = false;
$(window).scroll(function() {
didScroll = true;
});
setInterval(function() {
if ( didScroll ) {
didScroll = false;
You can’t perform that action at this time.