Skip to content

Instantly share code, notes, and snippets.

View mhujer's full-sized avatar
🏠
Working remotely

Martin Hujer mhujer

🏠
Working remotely
View GitHub Profile
@mhujer
mhujer / phpcs-shopio.xml
Created June 1, 2014 19:41
Shopio.cz PHP_CodeSniffer ruleset
<?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 / composer.json.patch
Created February 22, 2018 11:18
Enable PHPStan in PHPUnit
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 September 14, 2017 06:48 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# 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 April 1, 2017 11:12
ramsey/uuid serialization/deserialization benchmark
<?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 April 27, 2016 09:25 — forked from VasekPurchart/.bashrc
GIT global configuration and enhancements
# 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 / fix-photos-names-morava.php
Last active December 20, 2015 05:29
Useful snippets for renaming photos from different cameras
<?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 April 19, 2013 08:06
Nastavení AdBlock pro Bonami.cz
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 December 10, 2015 23:55
Export files from GIT repository to SVN-like structure
#!/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 January 8, 2013 21:55
E-maily přes seznam smtp padají do spamu - myslím, že vím proč
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 July 4, 2012 09:18
ZF2 failing tests on Windows (version d71b9ff712f2cebf406ea559e55f691404debfe6)
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