Skip to main content

Top 10 Mac Keyboard Shortcuts

Control + Option + Command + Eject shutdown time image This option is used to shutdown your Mac. This nice thing about doing this instead of shutdown menu is it bypasses the counter and immediately starts shutting down.

Command + Option + Eject Puts the computer to sleep bypassing the countdown.

Control + Shift + Eject Allows you to put the display to sleep

Command + Space-bar shutdown time image Use this shortcut to open up the spotlight bar to search for an application or a file.

Command + Shift 4 This will allow you to select an area of the screen to take a screen shot of. Generally your picture will be dropped to your desktop.

Control + Command + D Dictionary shortcut. This is not my most used command but it can be useful in situations

Command + TAB If you are familiar with Windows this is kind of like the Alt+Tab functionality to switch between open applications

Option + Command + M Sometimes you just want to minimize everything on the screen to remove some clutter.

Command + , Open up the preferences window for your application

Command + ← / → / ↑ / ↓ These commands are useful when handling a document or text.

Command + ← or → will take you to the beginning or end of line.

Command ↑ or ↓ will take you to beginning or end of page.

Comments

Popular posts from this blog

Reverse a number without converting to a string.

Sometimes I like to work on coding problems just for fun. Things like Project Euler, Code Eval Hackerrank etc. Depending on what language you decide to do things in it might be easier and more efficient to think a little different. Some languages like Ruby, for example, converting a number to a string with to_str() and then reversing is rather trivial. But what if I want to solve it by keeping the number a number? Currently, I am playing around with Rust so my example will be in that language however you can use this same formula in whatever language you like. pub fn num_reverse(number: i32) -> i32 { let mut num = number; let mut rev = 0; while num > 0 { rev = rev * 10 + (num % 10); num = num / 10; } return rev; } Now that we have the code lets map out a little bit of how it works. Let us take the number 1234. num = 1234; rev = 0; Grab the first digit. rev = rev * 10 + (num % 10) Which can be written as. rev = 0 * 10 ...

High Sierra and Valgrind Install

Valgrind is a tool used for memory management and profiling your applications.  I wanted to use it on my Macbook and ran into issues installing with brew and it turned out it wasn't too horrible of a change. brew update brew install --HEAD valgrind    Voila you now have a working run of valgrind. Happy Trails.

Javascript - Rounding numbers to decimal

function roundNumber(number, decimal) { return Math .round(number * Math .pow( 10 , decimal)) / Math .pow( 10 , decimal); } How it works The first thing to understand is how the Math.round() function works in Javascript. The round function takes what ever number that it is given and strips off everything after the decimal point. So if you have a number like 343.12345678 it will return 343. For this example lets say you want to have 2 decimal points left for your output like 343.12. To get the decimal points that we want we need to move the decimal point over 2 spots so that they will not be removed from the round function. Each decimal place is a factor of 10. Tenths, Hundredths, Thousandths, etc. Lets now multiply 343.12345678 by 10^2. 10 is the decimal and the 2 is how many we need to move. You should get 34312.345678. Now if you use the round function you will get 34312 right? So now that we have all the correct numbers we need to get the number back to the right value...