Category Archives: Programming

5 Essential Terminal Shortcuts

Terminal screen

The first time you see the Terminal screen, it’s very intimidating. “What am I supposed to do here How do I navigate? What can I type?” Over time, [cci]cd[/cci]-ing and [cci]ls[/cci]-ing will become second nature. Using a Command Line Interface (Terminal) is simply more efficient than leaving the comfortable home position to drag the mouse a few inches.

In OS X, Terminal wraps the Bash (Unix shell) application. I’ve learned some essential Bash shortcuts that will help you save time and be more efficient.

  1. [Tab]
    Command-line completion is amazing. Bash will automatically fill in partially typed commands. If you have a file named “profile-page.html” and hit [Tab] while typing out the first few letters, the rest of the file name will likely be auto completed for you.
  2. [cci]ls -a[/cci]
    While you probably know about typing [cci]ls[/cci] in a directory to show all files, typing [cci]ls -a[/cci] will let Bash show you all files (including the hidden ones) that Finder won’t show you by default.
  3. [cci]touch [/cci][file_name]
    The touch command takes in a file_name argument that is the file name created on the spot.
  4. [Cmd+T]
    Create tabs with [Cmd+T] Do you remember the first time you tried Firefox several years ago? Tabs are your friends.
  5. [cci]open [/cci] [target]
    The open command followed by the folder or file name will let you open up files in their default application.

Working out of the Terminal is amazing. If you’re interested in more power tips, I’d recommend reading about alias and subl symlink.

10 Tips for JavaScript Beginners

This JavaScript 101 post is based on the presentation JavaScript Syntax by Ynon Perek.

Puzzle pieces By liza31337

Puzzle pieces By liza31337

Ynon‘s slides do a great job covering key JavaScript fundamentals:

Values
1. Undefined refers to anything that hasn’t been assigned a value.
2. In JS, false is made up of false, null, unidentified, “”, 0, and NaN.
3. Everything else is truthy in JS.

Naming Conventions
4. Identifiers start with letters, _, or $. They are followed by letters, digits, _, or $.
5. Variable names are lowercased, with words split by _. Function names are CamelCased.

Variables
6. JavaScript has function scope.
7. Outside of functions, any variables defined have global scope and is accessible anywhere in the application.

Objects
8. Objects are a collection of key, value pairs.
9. Functions are normal JS objects.
10. function foo() {} is equivalent to var foo = function() {};

JavaScript and JQuery are powerful tools for implementing web page user interaction. The best way to get started is to try writing some JavaScript and look up anything that you’re not sure about.