Skip to content

Instantly share code, notes, and snippets.

View MarioBlazek's full-sized avatar
🎯
Focusing

Mario Blazek MarioBlazek

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MarioBlazek on github.
  • I am marioblazek (https://keybase.io/marioblazek) on keybase.
  • I have a public key whose fingerprint is 55F2 10D6 AF36 CD4C 0044 2F03 02DF 540D 7FEC 6218

To claim this, I am signing this object:

@MarioBlazek
MarioBlazek / vimrc.sh
Created August 17, 2017 11:05
Custom vimrc file
Plugin 'scrooloose/syntastic'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'mhinz/vim-signify'
Plugin 'vim-ctrlspace/vim-ctrlspace'
@MarioBlazek
MarioBlazek / gist:8c34953498121746c2da87132f77c4e9
Created October 13, 2017 12:49
Email validators comparison
+--------------------------------------------+----------+----------------+-------------------+--------------------+
| Email | Validity | PHP validate() | Symfony validator | ZetaComponent Mail |
+--------------------------------------------+----------+----------------+-------------------+--------------------+
| [email protected] | Valid | Valid | Invalid | Valid |
| [email protected] | Valid | Valid | Invalid | Valid |
| [email protected] | Valid | Valid | Invalid | Valid |
| [email protected] | Valid | Valid | Invalid | Valid |
| [email protected] | Valid | Valid | Invalid | Valid |
| [email protected] | Valid | Valid | Invalid | V
0 */1 * * * cd $EZPUBLISHROOT && $PHP app/console rdm:salesforce:import_trainings --siteaccess=$SITEACCESS --env=prod 2>&1
{
"name": "netgen/more-site",
"description": "Netgen More site (powered by Netgen & eZ Platform)",
"homepage": "http://www.netgenlabs.com",
"license": "GPL-2.0",
"type": "project",
"authors": [
{
"name": "Netgen",
"homepage": "http://www.netgenlabs.com"
<?php
try {
// your code
} catch (Throwable $e) {
echo 'Very nice way to catch Exception and Error exceptions';
}
@MarioBlazek
MarioBlazek / caught_fatal_error.php
Created April 15, 2019 14:09
PHP caught fatal error
<?php try {
// this will generate notice that would not be caught
echo $someNotSetVariable;
// fatal error that now actually is caught
someNoneExistentFunction();
} catch (Error $e) {
echo "Error caught: " . $e->getMessage();
}
Notice: Undefined variable: someNotSetVariable on line 3
Error caught: Call to undefined function someNoneExistentFunction()
@MarioBlazek
MarioBlazek / T_PAAMAYIM_NEKUDOTAYIM.php
Last active December 16, 2019 10:40
T_PAAMAYIM_NEKUDOTAYIM
<?php
class foo
{
static $bar = 'baz';
}
var_dump('foo'::$bar);
<?php
function myCustomErrorHandler(int $errNo, string $errMsg, string $file, int $line) {
echo "Wow my custom error handler got #[$errNo] occurred in [$file] at line [$line]: [$errMsg]";
}
set_error_handler('myCustomErrorHandler');
try {
what;