Learn Javascript

Objective: To teach Javascript using code snippets with explanations for practical use.  There will be random consistent updates made. I will try to answer questions in the comments section.

Note: These are not theory based lessons. They are being shared for those that learn by looking at practical detailed samples, then doing.

How to use these lessons:

    • When you see “//” followed by words, it is because it allows – generally text and not code – to be displayed for the author/s and is usually an explanation of the code.
    • When you see “console.log( );” It is a function that displays output to the screen so that you can see it. In most cases exist to show that the code is working as expected and not required.
    • Most of the snippets that you see here can be seen in real-time in any modern browsers console.

How to sum all of the numbers in an array range

Continue reading “Learn Javascript”

How to move Cornerstone repositories to another computer

I created this post because I use Cornerstone by Zennaware for version control and have several repositories and recently needed to upgrade from one Mac to a newer Mac.

I found a good post that got me started @ http://www.gigoblog.com/2014/05/19/move-cornerstone-svn-client-settings-and-data-to-new-computer/ . However, there are two important things that I did not find in the article that I’d like to point out for you that I ran into.

  1. The new computer should have the same user directory name as the old computer. So be sure that when setting up the new computer that the username matches the username on the old computer. This is not going to prevent you from accomplishing your goal but if you do not have matching usernames, the Cornerstone repositories are looking for then you will receive file path errors on the new computer. You will have to rename the path at that point which may take time and could lead to further steps.
  2. The correct locations to restore files are in the directory users Library directory. E.g. “Macintosh HD [or whatever your primary drive is named]/Users/[your username]/Library/Preferences/com.zennaware.Cornerstone.plist” AND
    “Macintosh HD [or whatever your primary drive is named]/Users/[your username]/Library/Application Support/Cornerstone”

  3. You can install Cornerstone before or after you being this process. The order should not make a difference. I installed it first.

That should do it.

Sinatra and postgreSQL perform on a heroku stage – tutorial

  • logo
  • postgresql-logo1
  • heroku-logo-for-facebook

Objective: To write a short tutorial the uses Sinatra DSL for the backend, is styled with the twitter bootstrap and PostgreSQL for the database and the heroku hosting platform for hosting.This is a branch off of a post about Learning Rails. I branched it because I found Sinatra interesting and wanted to document buildiing a production app.

Tools that are being used for this tutorial.

  • Macbook Air running OS X 10.8.5
  • Heroku account (FREE)

Continue reading “Sinatra and postgreSQL perform on a heroku stage – tutorial”