Skip to content

Instantly share code, notes, and snippets.

Martin Hujer mhujer

Block or report user

Report or block mhujer

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
@mhujer
mhujer / composer.json.patch
Created Feb 22, 2018
Enable PHPStan in PHPUnit
View composer.json.patch
diff --git a/composer.json b/composer.json
index d1d0595e5..6b04dc677 100644
--- a/composer.json
+++ b/composer.json
@@ -47,7 +47,8 @@
"sebastian/version": "^2.0.1"
},
"require-dev": {
- "ext-PDO": "*"
+ "ext-PDO": "*",
@mhujer
mhujer / boxstarter.ps1
Created Sep 14, 2017 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
#
# Learn more: http://boxstarter.org/Learn/WebLauncher
#---- TEMPORARY ---
@mhujer
mhujer / benchmark.php
Created Apr 1, 2017
ramsey/uuid serialization/deserialization benchmark
View benchmark.php
<?php
declare(strict_types = 1);
use Ramsey\Uuid\Uuid;
require_once __DIR__ . '/../vendor/autoload.php';
$data = require __DIR__ . '/dataset.php';
@mhujer
mhujer / .bashrc
Last active Apr 27, 2016 — forked from VasekPurchart/.bashrc
GIT global configuration and enhancements
View .bashrc
# used by Git (commit messages, rebase, ...)
export EDITOR=vim
# GIT bash current branch
# by HABR (modified by Dundee)
export PSORIG="$PS1"
function GITBRANCH() {
BRANCH="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)"
if [ -n "$BRANCH" ] ; then
export PS1=$PSORIG$(echo -en "\[\033[01;33m\]$BRANCH > \[\033[00m\]")
@mhujer
mhujer / phpcs-shopio.xml
Created Jun 1, 2014
Shopio.cz PHP_CodeSniffer ruleset
View phpcs-shopio.xml
<?xml version="1.0"?>
<ruleset name="Shopio Custom Standard">
<rule ref="Zend" />
<!-- Zend includes those
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
@mhujer
mhujer / fix-photos-names-morava.php
Last active Dec 20, 2015
Useful snippets for renaming photos from different cameras
View fix-photos-names-morava.php
<?php
/**
* Useful snippets for renaming photos from different cameras
*/
function fixUppercaseExtensions()
{
foreach (glob('*.JPG') as $photo) {
$newName = str_replace('.JPG', '.jpg', $photo);
rename($photo, $newName);
echo sprintf('Renamed %s -> %s', $photo, $newName) . PHP_EOL;
@mhujer
mhujer / gist:5418848
Created Apr 19, 2013
Nastavení AdBlock pro Bonami.cz
View gist:5418848
Pokud vám občas někdo pošle odkaz na Bonami.cz a vy se tam nechcete registrovat, tak to jde snadno řešit.
Běžte do Adblock -> Options -> Customize -> Manually edit your filters "Edit" a nakonec přidejte toto:
www.bonami.cz##DIV[class="loginOverlay-container"]
www.bonami.cz##DIV[class="overlay"]
@mhujer
mhujer / git-svnlike-export.sh
Last active Dec 10, 2015
Export files from GIT repository to SVN-like structure
View git-svnlike-export.sh
#!/bin/bash
# git-svnlike-export.sh
#
# Simple scripts that allows you to export GIT repository to SVN-like strukture
#
# I created it to check that our SVN repo was properly migrated to GIT.
# I than compared SVN directory with this export with Total Commander's
# synchronize directories feature
#
@mhujer
mhujer / gist:4488331
Created Jan 8, 2013
E-maily přes seznam smtp padají do spamu - myslím, že vím proč
View gist:4488331
Přítelkyně narazila na tohle - http://napoveda.seznam.cz/forum/viewtopic.php?f=14&t=14998 -
emaily poslané z outlooku přes smtp se vrátí a v hlavičce je:
Received: from adela (kxjema00.knet.vse.cz [146.102.105.99])
by email-relay1.ng.seznam.cz (Seznam SMTPD UNKNOWN@UNKNOWN) with ESMTP;
Tue, 08 Jan 2013 22:29:20 +0100 (CET)
From: =?iso-8859-2?B?QWTpbGEgSmVtZWzta2924Q==?=
---snip---
X-Smtpd: UNKNOWN@UNKNOWN
X-Session: 2
@mhujer
mhujer / gist:3046301
Created Jul 4, 2012
ZF2 failing tests on Windows (version d71b9ff712f2cebf406ea559e55f691404debfe6)
View gist:3046301
Zend/Acl:
PHPUnit 3.6.11 by Sebastian Bergmann.
Configuration read from I:\xampp\zf2\tests\phpunit.xml
................................................................. 65 / 68 ( 95%)
...
Time: 0 seconds, Memory: 4.75Mb
You can’t perform that action at this time.