Get Firefox to display warning message when exiting multiple tabs

This problem had been a nuisance for me for a while,  In the past, whenever I exited out of a window with lots of tabs, I’d get a nice warning message asking to confirm that I wanted to exit out of all pages.

popup

This was fantastic because, on a qwerty keyboard, Q and W are right next to eachother.  So, one slip of the finger turned a command to close a single tab into a command to close the whole darn window.  But it seems that new versions of  Firefox have disabled this warning by default.  Today, with the help of Mardeg from the #firefox channel on irc.mozilla.org, I re-enabled it!

Here’s how:

  1. Navigate to about:config?filter=browser.showQuitWarning in Firefox.URL
  2. Then you will be confronted with some warning about voiding your warranty (see below)Warning  You really needn’t worry about this for the setting we’re changing.  The warning applies to all navigations to about:config as some settings in there can indeed be precarious to change. This one is not.
  3. Next you will be faced with the setting itself.  setting  Simply double click on it or right click to toggle it as true.
  4. Finally close out of the tab and you’re done!  The next time you exit out of firefox with multiple tabs, you will receive a warning.
Get Firefox to display warning message when exiting multiple tabs

Cheatsheet for viewing commits/branches in git

A couple notes on different log flags that I use for a couple applications

Only shows commits that are referred to by current state of branch
git log --graph --all --decorate --simplify-by-decoration

Shows all commits from all branches in a tree
git log --graph --all --decorate

A few notes on reading a branch.

If you are confronted with something like the following:


* commit 4589a323c3eddc4f488ea856c49db86d76bfe65f (Branch_5)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Tue Apr 14 01:52:17 2015 -0600
|
| Commit 5
|
| * commit d168ac4d7ab7e80c85d0630dc00a67319293f6a7 (Branch_4)
| | Author: Neanderslob <neanderslob@neanderslob.com>
| | Date: Tue Apr 28 15:01:00 2015 -0600
| |
| | Commit 4
| |
| * commit 06a6299ede5a1d6abf562b3a4999d6b6905dae80 (Branch_3/Branch_4)
|/ Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Fri Apr 24 15:24:08 2015 -0600
|
| Commit 3
|
* commit 2118bcb9d2c5fae313841fa66a5af6294cf8ba31 (Branch_2)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Sat Apr 4 02:49:06 2015 -0600
|
| Commit 2
|
* commit 413697b0fbd36552613c51634080b419bf8ed6e9 (Branch_1)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Fri Mar 20 17:24:27 2015 -0600
|
| Commit 1

The way you read it is:

  • Branch_2 comes off of Branch_1.
  • Branch_3 and Branch_4 came off of branch 2 at the same point
    • Branch_4 is ahead of Branch_3
  • Branch_5 came off of Branch_2 as well but after 3&4 did
Cheatsheet for viewing commits/branches in git

Controller Cheat Sheet

Common in index method

Get all posts and save them to @post, ordered by when they were creating in descending order:

@post = Post.all.order("created_at DESC")

Get all posts by a particular user and save them to @post, ordered by when they were creating in descending order:
@post = current_user.posts("created_at DESC")

Common in new method

Create a new post for the current user when that user has_many posts:

@post = current_user.posts.build

Create a new post for the current user when that user only has_one post:

@post = current_user.build_post

To authorize which users can access what

See my post here.

Controller Cheat Sheet

Notes: basic psql commands

As I’m learning postgresql to develop with Heroku, here are my notes on some of the basic commands that are necessary to move around within the command-line interface.

Logging in under the postgres user (this would be like root in mysql)
psql -U postgres -h localhost

To list all databases:
\list

To connect to a database (similar to use database in mysql):
\c the_database

To list tables in that database:
\d

To list the columns in a particular table:
\d table_name

To view all rows in a given connected table (just the standard sql command):
select * from the_table

To quit out of the psql command-line utility:
\q

Notes: basic psql commands