IIO Sensor proxy: screen rotation

One of the things, I don’t get is why Linux enabled IIO Sensor Proxy default. With a GNOME 3.18 (or newer) orientation changes will automatically be applied when rotating the panel. Ambient light will be used to change the screen brightness. Geoclue will be able to read the compass data to show the direction in Maps. It’s really annoying on the laptops if you accidentally rotate your monitor. So here’s is a what you got to do:...

March 8, 2017 · 1 min · anvyst

PHP: Testing protected methods in CakePHP3

One of the things I recently had to deal with - PHP unit testing protected methods of the class in CakePHP 3. Few seconds of checking StackOverflow brought a nice and elegant way of checking protected methods using ReflectionClasses. Sebastian Bergmann has a complete guide how to check non-public functionality of the classes in his archieves. Here’s a short sample of the code using CakePHP3: <?php use Search\Model\Table\SaveSearchTable; use Cake\TestSuite\TestCase; class SaveSearchTableTest extends TestCase { public function setUp() { $this->SavedSearches = \Cake\ORM\TableRegistry::get('SavedSearches'); } public function testProtectedMethod() { $methodName = 'protectedMethod'; $reflectionClass = new \ReflectionClass('\Search\Model\Table\SaveSearchesTable'); $method = $reflectionClass->getMethod($methodName); $methodResult = $method->invokeArgs( $this->SavedSearches, ['arg1', ['arg2']]); $this->assertNotEmpty($methodResult); } }

February 7, 2017 · 1 min · anvyst

WP-CLI becomes part of make.wordpress.org

WP-CLI reached 1.x stable release. WordPress decided to make it as part of make.wordpress.org tools. Great news from the WordPress community and those who spends most of their time in the console. No more weird sftpd/vsftpd installations. It might come handy with composer bundle as we do it in Qobo for WordPress project templates. New home for WP-CLI docs https://t.co/oZleP9HwRX — WP-CLI (@wpcli) January 26, 2017

January 27, 2017 · 1 min · anvyst

PSR-7: storage-less sessions

The new session system was implemented by @srgmrzv using PSR-7 storage-less sessions: https://t.co/W6q2lm1Ryj https://t.co/fZFTrPuy3q — Matthieu Napoli (@matthieunapoli) January 26, 2017

January 27, 2017 · 1 min · anvyst

Silver Searcher: ack but faster

As a frequent user of grep/ack for the codebase, ag seems to be a silver bullet, especially for the projects with large codebase. Available in rpm repositories. What’s so great about Ag? It is an order of magnitude faster than ack. It ignores file patterns from your .gitignore and .hgignore. If there are files in your source repo you don’t want to search, just add their patterns to a .ignore file....

January 23, 2017 · 1 min · anvyst

CakeDC upgrade adds Google Authenticator

Few days of work, and almost a month of waiting. It was totally worth it. Yesterday noon, CakeDC community upgraded one of its major plugins with our Qobo patch. It allows users to enable Google Authenticator. There’s no need anymore to use ‘dev-develop’ branches in composer.

December 20, 2016 · 1 min · anvyst

Google Authenticator in CakePHP3.x

Google Authenticator gets a new wave of interest from the web community, trying to put an extra layer on top of user authentication process. There’s a plethora of plugins and components that let you authenticate with Google, but most of them aim to OAuth and Google+ integration. Two-step auth gets aside. I took few hours on research for the simple 2FA library available on the net and found TwoFactorAuth that already support Google URI QR-codes, that can be easily embedded into any framework/application running on PHP....

November 25, 2016 · 2 min · anvyst

Vim: statusline and git customizations

Working with lots of projects at the same time in qobo.biz, I started to get confused on which branch I’m currently working. Going back to the terminal, to check the diffs and commits, became a time waste in my daily routine, so I took a break during lunch, to get my vim plugins an upgrade. The catch of the day is the following: Vim-Airline Vim-Airline is a powerful status/tabline facelift of a default statusline with lots of customizations, and useful information on the files you work with....

November 23, 2016 · 2 min · anvyst

Definition of "done"

It’s been a long way for the definition to get to this blog post, so i’ll choose the one which favors the most, meanwhile its revision history: Paul M Jones: Definition of “Done” [2016] Mehdi Khalili: Definition of “Done” in MVC project [2011] Paul Stovell: “Done” criteria [2010] AgileFAQ: definition of “done” [2007-10] An example Story definition of done would look like this. All story should have automated acceptance test. The story should have working code supported by unit test that provide around 60 – 70 percent coverage....

November 20, 2016 · 2 min · anvyst

We are going to build a framework!

🎶 We're Gonna Build a Framework 🎶 by @dylanbeattie This is absolutely amazing 😂😂😂 pic.twitter.com/xLi88jWZ2B — DEV Community (@ThePracticalDev) November 14, 2016 And they built it!

November 20, 2016 · 1 min · anvyst