PHP beginner notes

25 Feb

Variables can be printed without quotation marks:

print $students;

Variables can be printed within double quotation marks but not single quotation marks:

print "Hello, $student" // This works

AppleTV 2 restore error

10 Jul

I got an error when trying to do a clean AppleTV 2 restore:
“This device is not eligible for the requested build”

To fix this I used TextMate to open my hosts file located in:
/etc/hosts

I commented out any line with gs.apple.com so that they looked like this:
#74.208.10.249 gs.apple.com
#127.0.0.1 gs.apple.com

This happened because I had previously used TinyUmbrella.

Fix Mac slow startup

8 Feb

Mac’s boot up time will sometimes get slow after installing BootCamp.

The fix is to reset the Mac’s PRAM and NVRAM
Turn on computer and hold these keys before the gray screen appears and until you hear the startup sound a second time.
Command, Option, P, R

Set Quicktime Player 7 as default MOV player in Snow Leopard

15 Mar

Quicktime Player X is hated by some and detested by others. Setting Quicktime Player 7 as the default MOV player in Snow Leopard is not as easy as we’re used to. You try to set Quicktime Player 7 as the default player but something called Quicktime Player Launcher prevents you from doing so and leaves you with Quicktime X. The file preventing you from doing what you want to do is inside the Quicktime Player 7 app and has nothing to do with Quicktime X.

The fix is to right click on the Quicktime Player 7 app and choose Show Package Resources and delete the file located here:

/Applications/QuickTime Player 7.app/Contents/Resources/QuickTime Player Launcher.app

Make adjustment layer only affect the layer below it

7 Jun

Select the adjustment layer and do the shortcut for your system:

PC: CTRL-G

MAC: Option & Command – G

Change default Safari Keyboard Shortcut for Google Search

18 May

Firefox uses the keyboard shortcut Command-K.  To also make this the default shortcut for Safari Google Search I did the following:

  • Open System Preferences
  • Click on Keyboard & Mouse
  • Click on Keyboard Shortcuts Tab
  • Click the Plus icon (bottom left) to create a new shortcut
  • For Menu Title Type Google Search then hold the Option key and press the semicolon key ;
    You should end up with Google Search…
    (Note: You can’t just type the dots)
  • Now click on the Keyboard Shortcut field and hold Command-K on your keyboard and click Add.
  • You’re done
    No need to restart Safari

Terminal tips

26 Apr
  1. Gain root access 
    Use sudo instead of su. You can also use sudo -s to keep you in the shell.
  2. Show hidden files
    # defaults write com.apple.Finder AppleShowAllFiles TRUE
    # killall Finder 
  3. Highlight stack items on hover
    defaults write com.apple.dock mouse-over-hilte-stack -boolean yes
  4. Create Symbolic links (AKA alias, shortcuts)
    sudo ln -s /Users/Steve/Music/iTunes /Users/Shared/Music/iTunes
     

    then, you’ll have to restart the Dock by issuing the following command:
    killall Dock

    To disable the hover highlights, type:

    defaults write com.apple.dock mouse-over-hilte-stack -boolean no