Elementary OS Linux on iOTA Flo 11.6″ laptop

Screenshot of iOTA Flo 11.6″ laptop at 1440 × 810 pixels (16:9)

A change this week for my smaller laptop, from Linux Mint to Elementary OS and I couldn’t be happier.

Continue reading Elementary OS Linux on iOTA Flo 11.6″ laptop

Organising tabs by groups in Google Chrome

Four tab groups in Google Chrome

Generally, I am a bit of a tab minimalist when it comes to my browsing habits—I don’t often have more than about five or six tabs open at a time.

At work, however, I am working with two teams (Kronos and Odin) and I was recently looking for a method to neatly group tabs relating to the two teams plus my general work stuff (email, HR system, Jira, Trello, etc.) and personal productivity applications (calendar, email, contacts, task list, etc.)

As I switch between teams quite regularly, I was finding myself taking a little too long to search my various tabs for the right one. Enter Google Chrome’s built-in tab groups. Now everything is much easier to find.

Continue reading Organising tabs by groups in Google Chrome

Writing to the Google Chrome console from PHP

Chrome Logger is a Google Chrome extension for debugging server side applications in the Chrome console.
Chrome Logger is a Google Chrome extension for debugging server side applications in the Chrome console.

This afternoon I finally got round to figuring out why my workaround for changing the Divi projects custom post type to anything you want had broken in Divi 2.5.

In the end it was deceptively simple. I’d set the priority values for the add_action($hook, $function_to_add, $priority) and remove_action($hook, $function_to_add, $priority) functions too low.

WordPress uses the priority value to determine in which order particular actions are run. The default value is 10. The higher the value, the later it will be executed.

While I was investigating this, it crossed my mind that it would be really useful if I could write values to the Google Chrome console in the same way that you can when writing and debugging JavaScript.

It turns out you can, using Chrome Logger plus the ChromePhp library.

With the Chrome Logger extension installed and enabled on the tab I wanted to write to, all I had to do was include the library and log some data. Like this:

<?php
    include 'ChromePhp.php';
    ChromePhp::log('Hello console!');
    ChromePhp::log($_SERVER);
    ChromePhp::warn('something went wrong!');
?>

Very useful. And as well as a library for PHP there are also libraries for

  • ColdFusion
  • Go
  • Java
  • .NET
  • Node.js
  • Perl
  • Python
  • Ruby

You can find details on the Chrome Logger website.

 

You can’t both be the default browser!

Screenshot of options screens of Chrome and Internet Explorer. They both claim to be the default browser.
Wait a minute! You can’t both be the default web browser!

I just spotted this strange anomaly on my PC at work. Both Google Chrome and Internet Explorer 10 are claiming to be the default web browser.

A quick visit to the “Default Programs” applet in the Control Panel and balance has now been restored.

Matching Google Chrome’s developer tools theme to your text editor theme

Sublime Text 2
Sublime Text 2

My main coding text editor is the excellent Sublime Text 2, my favourite theme is called Tomorrow-Night by Chris Kempson, and my go-to browser is Google Chrome.

Being involved in web design I use the Chrome web developer tools all the time for debugging JavaScript, identifying HTML classes and tweaking CSS. It looks like this:

Google Chrome developer tools
Google Chrome developer tools

But as you can see from the screenshot above, the default view is rather dull: white background, uninspiring syntax highlighting. It’s a shame that you can’t match the Chrome developer tools code panel with my text editor of choice.

User StyleSheets

Well, it turns out you can! Chrome provides a “User StyleSheets” directory into what you can drop a Custom.css file.

Windows
C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\
Mac
~/Library/Application Support/Google/Chrome/Default/User StyleSheets/
Ubuntu
~/.config/chromium/Default/User StyleSheets/

A number of people have also done the hard work for us and made available ready-to-use CSS files for various themes. These are my two favourite dark themes:

  • Tomorrow
  • Monokai (UPDATED: This version works better when editing code in the Elements tab.)

Having saved the code to your Custom.css file and saved it, Chrome updates immediately:

Google Chrome developer tools with Tomorrow theme
Google Chrome developer tools with Tomorrow theme