Category: Web

  • Going Mac – Part 2

    In a follow up to my previous posts, I’m updating my list of brew installs, and have discovered the bundle subcommand.

    Here’s my Brewfile:

    tap "homebrew/bundle"
    tap "homebrew/cask"
    tap "homebrew/cask-fonts"
    tap "homebrew/cask-versions"
    tap "homebrew/core"
    tap "homebrew/services"
    brew "btop"
    brew "freetype"
    brew "figlet"
    brew "httpie"
    brew "ncdu"
    brew "the_silver_searcher"
    brew "tldr"
    brew "unar"
    cask "alfred"
    cask "amazon-music"
    cask "firefox"
    cask "font-fira-code-nerd-font"
    cask "fontgoggles"
    cask "gitkraken"
    cask "http-toolkit"
    cask "hyper"
    cask "jetbrains-toolbox"
    cask "notunes"
    cask "postman"
    cask "proxyman"
    cask "rectangle"
    cask "rocket"
    cask "slack"
    cask "the-unarchiver"
    cask "whatsapp"
  • Form Validation Errors – don’t embarrass your users

    Form Validation Errors – don’t embarrass your users

    Does it seem fair to scold the user for the errors they make while filling in a form? Are they even “errors”?

    The term “Error” and the usual associated red colouring is remarkably negative. Almost like accusing the user of spilling blood by making a typo or misunderstanding a field’s intended purpose. Okay, perhaps that’s a little extreme, but it’s certainly not a fluffy “oopsie, shall we try again toghether?

    To work towards better UX we need to be compassionate, to be empathetic. If the user, who you want (nay, need) to be on-side, makes a mistake when filling in your form, there’s nothing to be gained by making them feel daft or at fault.

    This is a wonderful opportunity to improve the UX; simply by changing the tone of form validation messages from blame to guidance, your users are more likely to stick around.

    Some systems, especially internal systems for staff, may have the slightly troubling luxury of being mandatory for the users, but that shouldn’t excuse a poor experience.

    It’s important not to go so far into the fluffy language to appear patronising, and that can be a balancing act, so it’s worth working with copy editors, or even a small cross-section of the users, to land on appropriate messages.

    Contrast “That’s not an email address!” with “Please confirm your email address.“. Indeed, compare the message “Your Order Reference must not contain spaces” with code that just ignores the space – avoiding the messages in the first place can hugely improve users’ experience, which can increase engagement and goodwill and sales.

    We’re fortunate that we’re no longer writing things in stone. However uncomfortable it may feel to change something which exists already, we should use the freedom we have in software and web development, and make improvements wherever and whenever they’re identified.

  • How To Upload Video From Google Photos To YouTube

    Because Google apparently hate their users (including paying customers), it’s no longer possible to upload videos directly from their own service photos.google.com to their own service youtube.com, but you can share from the app to YouTube.

    So while it automatically uploads (backs up) to their servers, you will have to endure a slow concurrent upload to their servers.

    smh

  • Going Mac – Part 1

    Part of documenting my transition to web dev on Mac is to record what needs to be set up  & configured. Should things ever go awry, this post could be a shortcut to getting back to a work-ready state.

     

    Apps etc installed

    The following needed to be installed manually.

    The following were installed via the commands in the next section.

     

    Other tasks

    Show hidden files. Apparently this needs the command line!

     

    Commands run

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    brew update
    brew upgrade
    
    brew tap homebrew/dupes 
    brew tap homebrew/versions 
    brew tap homebrew/homebrew-php 
    brew tap caskroom/fonts 
    brew tap caskroom/cask 
    brew install node
    npm install --global gulp-cli 
    
    brew unlink php70
    brew install php71
    
    brew install git-flow-avh
    brew cask install font-fira-code
    brew cask install iterm2
    brew cask install gimp
    
    sudo xcodebuild -license

     

    Other changes

     

    References

    https://developerjack.com/blog/2016/08/26/Installing-PHP71-with-homebrew/

     

  • Going Mac – Part 0

    I’ll soon be starting a new job,  still in web development (as I have been for disturbingly more than a decade), though this time it’ll be in-house and for a huge company.

    I’ve been persuaded to go over to what I’ve long considered the dark side; Apple.

    I still don’t believe I’ll ever pay for Apple products with my own money, but it’s becoming clear that Windows really isn’t keeping up with the ease of development on MacOS, and my future employer will be the one stumping up the cash so what’s to lose?

    This is to be the 0th in a series of posts on my conversion, or will that be “enlightenment”? 0th not 1st because I’ve not started yet – I’m just beginning to look at what tools I’ll likely be using.

    Where I spend most of my work days at the moment is in the excellent JetBrains PHPStorm and I’m very pleased to see that I will be able to stick with it. The other software I use is the also excellent FileZilla and the frankly pretty ropey SourceTree. I will likely ditch both and finally get round to instead using the built-in functionality of PHPStorm, and, of course, modern deployment methods.

    I’m a fan of the command line, but it’s always been in *nix (mostly Debian on web servers and Raspberry Pis), so I’m hoping that the move to Apple will mean I can actually do all the modern web dev things instead of spending so much time persuading Windows to let me.

    So far, I’ve used all the contemporary techniques (proper MVC development, proper git usage like branching and pull-requests, npm, gulp, Sass), but never all in one project, and I’m really looking forward to it.

  • WordPress config snippet for dynamic domains

    Quite why this isn’t how WordPress works by default, I’ll probably never know.

    $domain = 'http' . (false ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];
    define( 'WP_SITEURL', $domain );
    define( 'WP_HOME', $domain );

    If anything, this snippet is for my own reference.

    Prevents redirects on development / staging sites without changing the wp-config.php

  • CSS3: Rounded Table Corners (No images)

    You cannot give a whole table (<table>) rounded corners using CSS, browsers will ignore it, you must round the corners of the cells (<td>) inside.

    The following uses CSS2 selectors (:first-child etc) and CSS3’s corner-rounding border-radius to selectively round the outer corners of the cells in the corners.
    This will work for any size table.

    table.rounded-corners tr:first-child td:first-child {
    	border-top-left-radius: 5px;
    }
    table.rounded-corners tr:first-child td:last-child {
    	border-top-right-radius: 5px;
    }
    table.rounded-corners tr:last-child td:first-child {
    	border-bottom-left-radius: 5px;
    }
    table.rounded-corners tr:last-child td:last-child {
    	border-bottom-right-radius: 5px;
    }
  • PHP Bug: json_encode() misleading warning on object with private properties

    I have found a peculiar issue with PHP’s json_encode() function.

    If you have an instance object with private properties and use json_encode() it will give you a very misleading warning.

    class ExampleObject {
        private $privateProperty;
        ...
    }
    $obj = new ExampleObject();
    json_encode($obj);

    results in

    Warning: json_encode() … recursion detected …

    There are two workarounds in the comments for the function at php.net but this is simply a PHP bug as far as I am concerned.

  • Firefox still has memory leak issue?

    I had to kill Firefox earlier today after noticing that it was using around 750MB of memory!

    It hung when I tried to close it normally, but perhaps I was just impatient.

    This time I’m going to give it the benefit of doubt and blame some crappy Flash advert or something.

  • BT (Bastards Telepunish) Woes

    My ISP, BT, have got my goat again.

    They’re punishing me by crippling my (already joke-worthy) download speeds, because I used a lot last week.
    So they’ll probably charge me for that (fair enough, I suppose).

    I understand that they need to provide a fair service to all their customers, but why does that have to mean reducing my speed when I’m not even trying to download excessive amounts? Surely they should simply cap my speed?

    A double punishment.
    I can’t even call to complain or plead my case because the relevant department is only open 9-5 Mon-Fri. Isn’t that absurd? They have the power to make their service even worse, on purpose, and don’t even have the guts to be around to answer for it.