Clockwork – PHP developer tools integration for Google Chrome

Clockwork is a PHP library and a Google Chrome extension that work together to provide a new tab in the Google Chrome DevTools for PHP developers.  The tab contains all sorts of useful information such as variable values, application tracing, timing, and more.

Google Chrome color profile

My good friend and colleague Michael Stepanov has been recently annoyed by some weird color offsets on his external screen in Fedora 26.  Turns out, it wasn’t the external monitor, video card, or cable issue.  The problem was with the new Google Chrome and its choice of the color profile.  The solution was found in this Reddit thread:

  • Open new tab and type there chrome://flags
  • Find option “Force color profile” and set it to “sRGB”
  • Restart Chrome and enjoy blue as blue 🙂

CakePHP with NightwatchJS on Travis CI

My colleague Andrey Vystavkin has been setting up a testing environment for our CakePHP projects recently.  We had one before, of course, using PHPUnit.  But this time we wanted to add Google Chrome headless browser with some form of JavaScript test suite, so that we could cover functional tests and a bit of front-end.  Andrey described the configuration of NightwatchJS on TravisCI in this blog post.  If you are more of a “show me the code on GitHub” person, have a look at this Pull Request (still work in progress) on our project-template-cakephp project.

Once we are happy with the TravisCI configuration, we’ll be bringing this setup to our BitBucket Pipelines environment as well.

The setup is also based around CakePHP framework, but it’s easy enough to adopt it to any other framework, PHP or not.

Browser screenshots with PHP and Google Chrome 59+

The release of Google Chrome 59 brought some really cool features.  One of them in particular was all over the technology news – headless mode.  Being able to run the browser engine without the graphical interface, and having control from the command line and API has many benefits.

One of the benefits is being able to take web page screenshots.  “Easily convert webpages to images using PHP” is one of the many blogs and articles that explain how to do it, using your preferred programming language (or mine in this case).  Browsershot is a very simple PHP library, which you can install with Composer and start using straight away.

I’ve tried it out and it works pretty well.  The screenshot above has been taken by the following script:

<?php 
require_once 'vendor/autoload.php';
use Spatie\Browsershot\Browsershot;

Browsershot::url('http://mamchenkov.net')
  ->windowSize(1600,900)
  ->save('screenshot.png');

Spellbook of Modern Web Dev

Spellbook of Modern Web Dev is a collection of 2,000+ carefully selected links to resources on anything web development related.  It covers subjects from Internet history and basics of HTML, CSS, and Javascript, all the way to tools, libraries and advanced usage of web technologies, and more; from network protocols and browser compatibility to development environments, containers, and ChatOps.

  • This document originated from a bunch of most commonly used links and learning resources I sent to every new web developer on our full-stack web development team.
  • For each problem domain and each technology, I try my best to pick only one or a few links that are most important, typical, common or popular and not outdated, base on the clear trendspublic data and empirical observation.
  • Prefer fine-grained classifications and deep hierarchies over featureless descriptions and distractive comments.
  • Ideally, each line is a unique category. The ” / “ symbol between the links means they are replaceable. The “, “symbol between the links means they are complementary.
  • I wish this document could be closer to a kind of knowledge graph or skill tree than a list or a collection.
  • It currently contains 2000+ links (projects, tools, plugins, services, articles, books, sites, etc.)

On one hand, this is one of the best single resources on the topic of web development that I’ve seen in a very long time.  On the other hand, it re-confirms my belief in “there is no such thing as a full-stack web developer”.  There’s just too many levels, and there’s too much depth to each level for a single individual to be an expert at.  But you get bonus points for trying.

Chrome Extension : var_masterpiece – turn PHP var_dump() into a thing of beauty

var_masterpiece

Var Masterpiece is a Google Chrome add-on, which formats PHP var_dump() output into something much more beautiful and useful.  You can customize the type colors and a few other things in the extension options, once installed.

Ask Slashdot: Best Browser Extensions — 2016 Edition

Slashdot is running a discussion thread on what are the best browser extensions these days.  The comments cover a variety of browsers and all kinds of extensions.  The most popular are, of course, well know.  But there are a few gems here and there.

snooze_panel

For me personally, I’ve picked the Tab Snooze extension.  I’ve tried quite a few tab management solutions, and neither one of them fits my needs even though most tried (I want to run a single browser window, with dozens or hundreds of tabs open, but I want them to be organized into groups and hidden until later, when I need them).   Tab Snooze approaches the problem from a slightly different angle. It sets the reminder for when to reopen the tab, and once that’s done, it closes the tab.  You can find all snoozed tabs and open them before the due date, of course.

This works surprisingly well for me.  If only I could control the opening of the tabs with something like “17 tabs were woken up and are about to be open. Continue?”.  Currently, I get the notification and the tabs are open automatically, which is often not at the best time.  Waking up a lot of tabs can slow the system down a bit and get in the way of things on which I’m working at the time.

Why I left my new MacBook for a $250 Chromebook

Why I left my new MacBook for a $250 Chromebook” is a nice write up of a new Chromebook user.  Even though I don’t own a MacBook (or any Mac products for that matter), I have been considering a Chromebook for a while now too.

My biggest concern is obviously programming and system administration tools – editors, terminals, remote access, etc.  But it’s getting there.

Apart from the experiences and wishlists, I found these two links useful:

Chrome apps … mind blown!

Don’t ask me how, but I’ve ended up in the Google Chrome Web Store, where I spent the last three hours – especially in the Productivity -> Developer Tools category.  I knew, there were plenty of apps to make Chrome OS / Chrome Browser super awesome, but it seems it’s been a while since I looked in there … My mind is officially blown!

I don’t need much from my Fedora laptop – a browser, a terminal, and some instant messaging apps.  But these days apparently that’s too much.  A lot of the things I do through the regular day can be handled right from the browser apps.

mysql

Here are some examples.

  1. Text editors.  There is a slew of them!  Simple and complex, specialized and generic, fast and … not so much.  Have a look at Caret for example.  It’s Sublime-like editor, based on the Ace editing component.  It offers a selection of themes, syntax highlighting for all the major languages, multiple tabs, project settings, and more!
  2. SSH client.  Yup, that’s right.  You can connect to your remote servers right out of the browser, using, for example, ServerAuditor.
  3. MySQL clients.  Choose between a simple command-line one, like MySQL Console.  Or a full-featured one, with ERDs and database browser, like Chrome MySQL Admin.
  4. Git, GitHub, and Gist tools.  Which there is a variety of…
  5. Web server (yes, really, a web server running in the web browser!) – Web Server fro Chrome, debugger (Xdebug), and compiler (Compiler.work).

Most of these offer session saving, networking synchronization, Google Drive data saving, social network integration, etc.

Wow!  The browser world has come a long way since Netscape 3 …

 

Good bye Google Chrome, hello Chromium

Google dropped the support of its Google Chrome browser on 32-bit Linux operating systems.  This is very unfortunate, but not deadly.  This change doesn’t affect the Chromium browser – the Open Source project behind Google Chrome.

Chromium-vs-Google-Chrome

The two are very compatible.  In fact, if you use the Google Sync in Google Chrome to synchronize your passwords, bookmarks, settings, etc. to Google, then Chromium will just pick them all up from there, once you login.  All your extensions will get installed and will continue working as well.

Here’s a link for those Fedora users who want to perform a manual installation.  Using dnf is probably easier:

dnf copr enable spot/chromium
dnf install chromium

Hopefully, 32-bit Linux Chromium will survive much longer…

Update:  Here is how to bring back Flash plugin, for those who need it:

wget http://mirror.yandex.ru/fedora/russianfedora/russianfedora/nonfree/fedora/updates/23/i386/chromium-pepper-flash-20.0.0.306-1.fc23.R.i686.rpm
file-roller --extract-here ./chromium-pepper-flash-20.0.0.306-1.fc23.R.i686.rpm
mv usr/lib/chromium/PepperFlash /usr/lib/chromium-browser/

Restart chrome after that and verify that you have the Adobe Flash Plugin on the about:plugins page.