Google Drive: View Files Largest to Smallest

While doing some spring cleaning (mentioned yesterday) – I decided I needed to go through my files on my Google Drive™.

One of the most helpful things: listing all my files from largest to smallest. I found I had some really old (And large) files that I will never need again.

How to list files from largest to smallest:

  1. Log into your Google account
  2. Go to this URL: https://drive.google.com/drive/quota

Remember – if you decided to delete your files – make sure you empty your trash to ensure they are truly gone.

Follow-up

Having the ability to see the size of the files allowed me to easily go from:

to:

Most Preferred Network on Your iPhone

I recently ran into an issue where my iPhone would seem to always try and connect to the one network I did not want to use anytime I left the house/came back. After I had enough manual switching – I finally took a look and learned how Apple orders the networks to join: https://support.apple.com/en-us/HT202831 and then looked at my settings. I noticed that my preferred network had “Auto Join” set to “no” and “Auto Join” set to “yes” for the slow network I had grown to hate.

If you have the same issue – go to your WiFi settings on your iPhone and click on the info icon for that connection. You will then see a screen like this:

From there – if you want your iPhone to prefer/join the network – make sure the Auto Join setting is turned on. If you want to not join it – simply make sure Auto Join is turned off. Makes sense and is super easy and no more manually changing the network every time you leave/come back. Simplify your life and make sure any non-used networks have Auto Join = off.

Disable the Cache in Safari 11

With Safari 11 – we lost the “Disable Cache” in the Safari Developer menu. If you are a developer – you know this comes in handy when debugging any CSS/JS changes.

After spending a few days frustrated – it was time to find a solution so I could disable the cache (permanently). If you are looking for the same solution – look no further.

Using the command line:

rm -rf ~/Library/Caches/com.apple.Safari ; echo > ~/Library/Caches/com.apple.Safari

That will remove the current cache forever and replace it with a file (not used to do any caching).

You are welcome.

Fix for Bold Fonts Looking Bolder in Chrome

If you noticed your fonts in Chrome looking more bold in Chrome than Safari – there is an easy fix. Add this in to your stylesheet (body or specific CSS class/ID):

Example:

h1 {-webkit-font-smoothing: antialiased;}

You can see the difference:

Before:

After:

Mac OS 10.2.2 SSH Keys Passphrase Help

If you are like me and a few days ago – noticed that you were getting prompted for your passphrase when using your SSH keys (instead of using the keychain) – here is how you can make a small change to no longer enter your password each time: http://apple.stackexchange.com/questions/254468/macos-sierra-doesn-t-seem-to-remember-ssh-keys-between-reboots/264974#264974

Add Bootstrap Classes to the Next and Previous Image Buttons

When viewing media (usually the image.php template) within WordPress – there are buttons to browse the next and previous buttons that you might want to customize if you are creating a Bootstrap WordPress them. If this is the case – styling the buttons with Bootstrap is easy. You can simply add the following to your theme’s functions.php file.

/**
 * Add CSS class to image navigation links.
 *
 * @wp-hook previous_image_link
 * @wp-hook next_image_link
 * @param   string $link Complete markup
 * @return  string
 */
add_filter( 'previous_image_link', 'lucidity_img_link_class' );
add_filter( 'next_image_link', 'lucidity_img_link_class' );

function lucidity_img_link_class( $link ) {
    $class = 'next_image_link' === current_filter() ? 'next' : 'prev';
    return str_replace( '<a ', "<a class='btn btn-default $class'", $link );
}

Note – you can change the btn-default class to btn-primary or whatever you need.

Add Bootstrap Button Classes to the WordPress Comment Form

Looking to stylize that WordPress comment button on the WordPress comment form? Adding the correct classes needed to the comment form button are as easy as finding where comment_form() is called in your theme. In my cases – this is within the comments.php file.

Once you find that – you just need to change
comment_form()
to:

$args = array(
'class_submit' => 'btn btn-default',
);
comment_form($args )

There are a number of modifications you can make to the comment form (changing button text, changing labels, adding notes, etc that you can make with the comment_form() function which are worth looking at here: https://codex.wordpress.org/Function_Reference/comment_form

Add Bootstrap Classes to WordPress Widgets

When creating your Bootstrap WordPress themes, you will notice the sidebar widgets (archives, categories, etc) which use dropdowns do not share the Bootstrap styling because there is no place easily accessible to add in the needed classes or CSS.

Considering the options – here are two ways you can turn those default selects into something that matches the rest of your beautiful Bootstrap site.

Add a filter in your functions.php file

This is specific to the category dropdown. I was hoping we could use the same on the widget_categories_dropdown_args filter, but that is not possible as of WordPress 4.6. (see next example to address this). This filter works great if you use the categories widget and no other that display a select.

/**
 * Add CSS class to sidebar category selects.
 */
add_filter( 'widget_categories_dropdown_args', 'lucidity_widget_categories_dropdown_args' );
function lucidity_widget_categories_dropdown_args( $args ) {
    if ( array_key_exists( 'class', $args ) ) {
        $args['class'] .= ' form-control';
    } else {
        $args['class'] = 'form-control';
    }
    return $args;
}

Add some Bootstrap CSS to your style.css file

This works great if you have multiple selects displayed within your widgets. Note: the sidebar in the example has an ID of “sidebar”. This CSS is brought over from the Bootstrap .form-control style.

#sidebar .widget select {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

I hope this helps make your site a bit more cohesive with the Bootstrap styles!

Find Large Files in *NIX

I recently ran into an issue where backups for a project were taking much more space than I thought they should. I figured there was a large error log somewhere – and sure enough I was able to easily find it with the following command:


du -sh *

That command du (disk usage) along with the options -sh (s = summarize, h = human readable) will then output something like this:

7.9M	admin
700K	api
1.4G	delivery
4.0K	error_log
44K	images
4.0K	index.php
4.0K	robots.txt

From there I can then see that the big disk space hog is in the “delivery” directory. Running the command then within that directory then showed there was a huge 1.4G error log which needed addressed.

This command is very useful and will save a lot of time if you run into a similar situation as I did.