Posts Calendar

How often do you code something and need to delete a wrapping link or div? I was using PHPStorm and had grabbed some code from another file that had links in the

tags which weren’t needed in the new file. I didn’t want to manually remove each link and after a quick look around PHPStorm’s menus, discovered that PHPStorm has a really useful command to remove the wrapping element for you.

Select the element, then from the menu, choose Code > Unwrap/Remove… or use the keyboard shortcut, Command + Shift + Backspace and then choose the appropriate wrapping element to remove.

I was setting up a Raspberry Pi Zero in an office to use for displaying a slide show of pictures on a TV in the waiting room and dismayed to learn it would constantly go to sleep after a few minutes. I researched and tried setting the consoleblank=0 in config.txt with no luck along many other solutions, but learned none of them worked for the Raspberry Pi Zero.

I finally figured out one fix that worked that’s easy to use. Open Terminal and run the following command:

Shell

1

2

sudo apt-getupdate

sudo apt-getinstall xscreensaver

I’m not sure why, but I got an error that some dependencies were not installed. If that happens to you as well, run this command in terminal:

1

sudo apt-get--fix-missing

and then run the install for xscreensaver again

Shell

1

sudo apt-getinstall xscreensaver

Now under Preferences, you’ll see a new option for screen saver.

On the Display Modes tab, you’ll see a drop down for Mode. Choose “Disable Screen Saver”

I recently got a new mac and was migrating a VMWareWindows Virtual Machine from my other computer. When starting the virtual machine, I received a random message from VMWare Fusion saying “Cannot find a valid peer process to connect to.”

The fix was rather simple as it was just Apple blocking VMWare from running. To fix it, follow these steps:

Open System Preferences by searching in Spotlight or clicking the gear icon in the dock.

On the top row there is an icon for Security and Privacy – Click that icon

Near the bottom of the screen that appears the following statement “System software from developer “VMWare, Inc.” was blocked from loading”

While setting up a new computer, Windows was throwing up warnings that files transferred from a backup drive might be unsafe. The files were text and images, so the warnings were safe to ignore but the directory had over one thousand files. Rather than unblocking each file manually, WindowsPowerShell makes it easy to unblock files in bulk.

For one folder without subdirectories, this snippet will do the trick.“$env:userprofile\Downloads“ tells PowerShell to use the Download folder for the logged in user and unblocks all files in it. Change this to the folder path you need if it’s not the Downloads folder.

PowerShell

1

get-childitem“$env:userprofile\Downloads“|unblock-file

If you have sub-directories and need to unblock everything, use the -Recurse flag:

PowerShell

1

dir“$env:userprofile\Downloads“-Recurse|Unblock-File

Want to see a report of files to be unblocked before running it? The -WhatIf flag will show you without executing.

I created a website where I’m using gulp to create a minified version and had to switch to another computer. For whatever reason, gulp install wouldn’t install the dependencies automatically, even when using the “npm-install-missing” plugin.

Add this script to the beginning of your gulpfile.js before the requirements, and when you run gulp, it will install the dependencies automatically. Be aware you’ll need to rerun your gulp command after the script completes.

One of my single page sites that had been live for months with no changes suddenly had the menu stop functioning in Chrome only. I can’t find an exact reason for the break, but I did find a cross-browserJavaScript solve that fixes the issue nicely. Just add the snippet to your site and the links should work automatically. Note that this fix requires jQuery but can be converted to VanillaJS.

Someone reached out to me today for help as the fix broke their WordPress site. If you’re using WordPress, this version uses the compatibility version of jQuery they provide out of the box. Be sure to place it in a javascript file and not your functions.php. Rui was kind enough to confirm the fix also works for Drupal 7.

Recently we purchased a bunch of Teensyduino powered buttons for a trivia game we were building for a client’s convention as a fun learning experience. Now that the conference is through, the buttons are sitting unused, and my boss asked me if I could reprogram one of them so he could use it to send emails through Outlook on Mac.

It was a fun little exercise since I’ve never worked with programming Teensyduinos before. It turned out that this wasn’t so complicated to accomplish. I figured I’d share the script in case anyone else would find it useful.

Use a mac? You’ll want to grab Alfred App. I’m finding it an invaluable replacement for spotlight and the workflows allow me to supercharge my workflows. It’s so useful that I’ve purchased the Powerpack lifetime license.

In addition to the standard features, here are a list of the most useful workflows for dev/tech:

Timer – by Daniel Bader I use this one a lot. It’s super simple and by writing “Timer” and the number of minutes, you can easily set a reminder. It’s great for anyone using the Pomodoro technique or even if you leave something on the stove and want to go back to work.

Incognito – by NedwoodI find myself using this when I need to test a page and bypass the cache. Type ‘incog [url]’ and it’ll launch a new chrome window in incognito mode.

Find Folder by Samvlu Finds a folder by name. I find this is faster than spotlight in just about every search.

Smart Folders by DeanisheList all the Smart Folders/Saved Searches (same thing) on your system and drill down into their contents. Works in much the same way as Alfred’s File Filter, but Smart Folders are also available outside Alfred and are a bit more flexible.

For example, you can configure a Smart Folder to show all video/audio/image files without having to specify each different filetype individually. If you already use Smart Folders, this workflow can save you the work of re-implementing them as File Filters.

What’s more, you can exclude specific filetypes with a Smart Folder, which Alfred cannot do.

mapsethome <home address including street number, name, postcode> (i.e. what you would type into Google Maps) mapsetwork <work address including street number, name, postcode> (i.e. what you would type into Google Maps) Commands for Use:

maps <query> – Search Google maps for an address dir <query> to <query> to <query> etc (seperate multiple addresses with ” to ” minus the quotes, and you will get a multiple location search) dirfw Show directions from Work to address dirfh Show directions from Home to address dirtw <query> Show directions from query to Work address dirth <query> Show directions from query to Home address trafficw – Show traffic from Home to Work traffich – Show traffic from Work to Home

Date Calculator I find myself needing to calculate differences between dates in my personal life a lot lately. This workflow saves me a lot of time to do that. Want to know how far Christmas is away in days? ‘dcalc 12-25-16 – now d’ returns the number of days (assuming you’re using the US short format like I am).

Wifi Control by miroman All my Macbooks periodically have issues with wifi. I’ve never been able to figure out what’s causing it but I use Wifi Control to restart the wifi which allows me to connect successfully.

Bugnot by vitor If you use bugmenot at all, this is a useful extension to get logins without loading a new tab. Type ‘bn domain.com’ and you’ll get a list of matching passwords to use.

I recently upgraded to Office 2016 on my Windows 10 desktop and was getting the error “Converter failed to save file” when double clicking on the file along with an “There was a problem sending the command to the program error” every time. I finally had enough with the annoyance to troubleshoot it and figured out a solve.

If you see anything other than Excel as the default, you’ll need to change the default to Excel. For me, the issue was the Open XML Converter not being installed anymore after upgrading to 2016. To change the default, select the format, click the “Change Program” button and select Excel 2016 from the list of apps that pops up and click OK to set the association:

You’ll need to do this for each format in the list to correct it. The most common formats you’ll use are XLS, XLSX, & XLT.

I find myself using this command on Digitalocean droplets fairly often and am sharing in case anyone else finds it useful. Use this one line to install all updates, security fixes, and system upgrades.