source from: https://codepen.io/mxbck/pen/EvmLVp/

Share This:

  • Comments Off on Sekeleton App in Pure CSS

SCSS crash course; aka – collection of existing sources used as a reminder for myself, and perhaps some random dude…

Share This:

  • Comments Off on SCSS and CSS in 2018 – my long overdue updates of what’s possible

Why you should reconsider your decision – support

Let me give you one example… let’s say you need to submit your homework or need to access your class, etc. Now imagine that the website and the whole university portal is down twice a week (which is not uncommon), so what you do? You contact technical support. They will probably answer within 24h (like this is helpful if your deadline is in next few hours). You explain your problem, and this is what you get:

1. Clear your browsers’ cache and cookies (after clearing your cache, please close all browser windows and start a new browser session) www.refreshyourcache.com
2. Close the browser, then re-open it.
3. Try an alternate browser (Internet Explorer, Firefox, or Chrome).
4. Reboot the computer/laptop.
5. Try a different computer/laptop.

So you take a deep breath, you try to explain you did all of that, and if you get some answer at all (which is not uncommon for them not to answer at all) you get something like this:

…it appears to be some kind of computer issue on your end causing this issue.

Thank you very much for nothing (as usual). You try to take another deep breath and explain that unless they won’t borrow you their PC, it is not going to solve your problem. After that, they usually stop answering for good.

You try to log the next day and suddenly everything works as expected… issue on my pc? Let me be clear here! I didn’t reboot my PC at this point, not even closed my browser…

Now you might be thinking; this guy is just moaning… yes, I tried contacting them, by phone, email, wrote an official complain, participated in their surveys… no change at all, same shit all the time…

This is only a tip of an iceberg and I’m going to post every shit they did and will do from no one until they will realize they can’t ignore customers paying 1.3k for one module and get away with this shit.

Kirk out

Share This:

  • Comments Off on The University of Liverpool – support

The config for IPTables is located:
/etc/sysconfig/iptables

I added the following line to it:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT

Reloaded IPtables:
sudo service iptables reload

Sanity check:
sudo iptables -S

Share This:

  • Comments Off on Allowing Redis port – iptables

short answer – you can’t…

shorter answer – use stat:
stat -c '%A %a %n' *

Share This:

  • Comments Off on ls – how to get octal file permission

Checking nested structure with isset does not work anymore!

In the project I’m working on currently, all the models extends from ArrayObject:

Now, I found the following on many places (or similar-ish):

The brand model:

Before, if I would check for properties inside the model with isset($this->$key), however, this is no longer working if the property is private!!! Isset is not a function so it was not throwing an error on checking not existing indexes/properties.

The code before:

Now

The isset is however working on protected and public, only accessing private properties is messed up.

Furthermore, they argue it is a “bugfix” (if you bother to read the issue comments), however, I think it is extremely stupid to fix such a important function in a minor release. Shame on you!!!

PS: credit for stealing cookies goes to Ocramius 😉 https://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/

Share This:

  • Comments Off on PHP 7.0.6 isset not working properly – anymore

February 9, 2016 | In: Programovanie

SVN repo size

svn list -vR file:///path/to/svn/folder/* | awk '{if ($3 !="") sum+=$3; i++} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'

Share This:

  • Comments Off on SVN repo size

how to run phan on debian

First, go here, here and here to get an idea about how to get phan working.

For Debian8 though, I had to do a few more tricks to get it running.

If you still haven’t try php7 (shame on you!) check this guide: how to install php7 on debian8 and redhat6.

To compile phan, you will need a phpize. For some reason it couldn’t resolve the dependencies automatically so here is what you will need:

than php readline and sqlite3:

and finally you should be able to install:

You can now go back to phan and you should be able to compile it (finally):

This will build your ast.so, which is located (on debian8):

Now you need to configure php-cli and load your new module. Check where the all the interesting ini/conf files are:

On Debian you probably want to check:

If everything went fine (like it ever does…), you are good to go with phan install:

That should do the trick and you can run phan from your command line:

And if you are lucky enough, and wont end up with segmentation fault as I did (try to run it on sub folder), you will see a lot of interesting things:

If you want to experiment with other libraries, checkout the post from php7 analysis tools.

Share This:

  • Comments Off on running phan static analyzer to check php5 to php7 issues

December 9, 2015 | In: Programovanie

php7 Anonymous Classes

Anonymous Classes

It is exactly what it says, but when can it be useful?

Ever found your self refactoring a pile of shit like the following code?

and then wherever you look you see casting it back to array?

and then somewhere else

and some more

and some more

Finding your self doing something like that? Then stop it! Seriously!

You know by now that you want to replace it with some model or real object, but you want to do it step by step and not brake anything.
Now how to do it? The answer is refactoring. I found anonymous classes super useful when replacing crap like that. As first step you can define anonymous class to confirm that everything still works as expected (if you have unit tests, if not – heaven help you!). And start replacing all the crap with your new object:

And what you get is the nice model ready to be tested and you are ready for next steps.

more about php7:

if you need to install PHP7 check out this article

php7 null coalesce operator ??

php7 class return type

Share This:

  • Comments Off on php7 Anonymous Classes

Variance and Signature Validation – basically in simple layman’s term – class return type

then interesting thing I find about the example from

more about php7:

if you need to install PHP7 check out this article

php7 null coalesce operator ??

Share This:

  • Comments Off on php7 invariants and signature validation or class return type