Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modify README.md and add setup helper

  • Loading branch information...
commit 904b8d721697dd18cf01a84a8cf193e99b52a3ba 1 parent bcfa416
@siddMahen authored
Showing with 118 additions and 110 deletions.
  1. +70 −1 README.md
  2. +0 −109 intro.js
  3. +48 −0 setup
View
71 README.md
@@ -1,3 +1,72 @@
# learning js
-These are a series of quick tutorial style lessons I wrote for compsci class.
+Let's learn some javascript!
+
+## Getting Started
+
+Before we can begin these tutorials, you're going to have to install
+[node.js](http://wwww.nodejs.org/). Node.js is a command line program which
+allows us to execute javascript without a browser.
+
+## Our Programming Environment
+
+Since node is a command line program, the majority of our programming will
+occur on the command line. On Macs, the command line can be accessed through
+the Terminal application.
+
+The command line is a text interface to your computer which allows you to
+write and edit software, navigate the file system and execute programs, among
+many other things.
+
+Here are a few basic commands to get you started:
+
+* `ls` - `ls` stands for list. `ls` will list the files and sub-directories
+in you current directory. For example, in a directory called Cookie Recipes,
+`ls` may yield the following list: ChocolateChip.txt Oatmeal.txt
+
+* `cd [some directory]` - `cd` stands for change directory. The parameter you
+pass to `cd` is the directory you will be taken to. For example:
+`cd ~/Desktop/` will take you to your Desktop directory.
+
+* `clear` - `clear` clears the console screen, giving you a blank slate to
+work with.
+
+## Our Editor
+
+This course will use Vim as it's command line text editor.
+
+Vim is an extremely powerful, yet minimal text editor. I guarantee
+that not only will Vim become your preferred way to edit code, but it will
+also become your preferred way to edit text in general.
+
+To quickly setup Vim before we begin, please run the following command in this
+projects root directory:
+
+ $ ./setup
+
+For a gentle introduction to Vim, please run the `vimtutor` command on the
+command line.
+
+## License
+
+(The MIT License)
+
+Copyright (C) 2012 by Siddharth Mahendraker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
109 intro.js
@@ -1,109 +0,0 @@
-/*
- * Programming is the art of making a computer do what you want.
- *
- * By themselves, computers are relatively stupid. They don't understand
- * how to do anything unless they are explicitly told what to do.
- *
- * By programming a computer, you are basically telling it what to do.
- *
- * Fundamentally, a program is a sequence of statements which are interpreted
- * and executed by the computer.
- *
- * For example, the following would be a program to make you a nutella
- * sandwich:
- *
- * buy bread.
- * buy nutella.
- * slice bread.
- * apply nutella on bread.
- *
- * Ofcourse, this does not work in reality as a computer does not understand
- * the instructions "buy", "slice", "apply", or the items "bread" and "nutella".
- *
- * In reality, computer programs are created using programming languages. These
- * languages are relatively easy for a computer to translate into yet another
- * language, called machine code, which the CPU understands.
- *
- * Before you begin programming, it is important to understand how programming
- * languages are converted into machine code.
- *
- * This process is facilitated by a compiler. A compiler is a program which
- * takes input from one language and turns it into another (often simpler)
- * language.
- *
- * The compilation of the code by the compiler follows three main steps:
- *
- * 1. Preprocessing
- * 2. Compilation
- * 3. Linking
- *
- * In preprocessing, the compiler checks that the source code is properly
- * formatted and that the code written is indeed valid code.
- *
- * In the compilation, the compiler converts the source code into machine
- * code which can be understood by the computer.
- *
- * In the linking step, the compiler takes the final program (now in machine
- * code) and attaches the necessary system hooks, so it can be run as a
- * program.
- *
- * Note that in reality, compilers are often highly complex programs and
- * are notoriously difficult to create. The steps described here are a vast
- * simplification. In reality, compilers perform many more operations along the
- * way; most notably optimization, static analysis and macro expansion.
- *
- * Now enough theory, lets write our first javascript program :D
- *
- */
-
-var name = "Siddharth";
-console.log(name);
-
-/*
- * To run this program, open the terminal window and run the command
- *
- * node intro.js
- *
- * Now that we see what the program does let's step through it line by line.
- *
- * var name = "Siddharth";
- *
- * This line creates a variable called "name" and sets it's value to
- * "Siddharth". In javascript, variables are created using the var keyword.
- * For example, all of the following would be variables:
- *
- * var cookies = "yummy";
- * var number = 7;
- *
- * You can probably guess what the values of these variables will be.
- *
- * Variables allow you to easily manipulate values. You can perform operations
- * on variables, read the value of variables and set variables to new values.
- *
- * In the second line, we pass the variable "name" to the function
- * "console.log".
- *
- * console.log(name);
- *
- * Functions are little operations within programs which can be reused to
- * make code cleaner and easier to write. Functions have an input and an output,
- * which can both be nothing. Generically, functions are used in the following
- * manner:
- *
- * functionName(inputOne, inputTwo, ...);
- *
- * We will talk about functions a little more later, but for now, understand
- * that the "console.log" function accepts one variable as input and prints
- * the value of that variable. Notice that it does not return an output.
- *
- * Before you go, there are a few things you should know about javascript
- * syntax.
- *
- * Every line of the program, or statement, should end in a semicolon ";".
- *
- * Lines which begin with "//" are comments. Comments are ignored by the
- * compiler, and hence have no effect on the program. Comments can also
- * be created by enclosing text in "slash*" "*slash". This text has
- * been placed inside a comment.
- *
- */
View
48 setup
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+restore=$PWD
+cd ~
+
+# Get a nice .vimrc file
+
+curl https://raw.github.com/gist/4052744/5e1241708364c21323213b7d1a2fbdf2a8eaf1ef/.vimrc \
+ > .vimrc
+
+# Create a nice .vim directory
+
+mkdir -p ~/.vim
+mkdir -p ~/.vim/undo
+mkdir -p ~/.vim/backups
+
+# Get pathogen
+
+mkdir -p ~/.vim/autoload ~/.vim/bundle; \
+curl -Sso ~/.vim/autoload/pathogen.vim \
+ https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
+
+# Get some bundles
+
+cd ~/.vim/bundle
+
+# Get synatastic
+
+curl -SsL https://github.com/scrooloose/syntastic/archive/master.tar.gz \
+ > syntastic.tar.gz
+tar -xzf syntastic.tar.gz
+rm syntastic.tar.gz
+
+# Get vim-javascript
+
+curl -SsL https://github.com/pangloss/vim-javascript/archive/master.tar.gz \
+ > vim-javascript.tar.gz
+tar -xzf vim-javascript.tar.gz
+rm vim-javascript.tar.gz
+
+# Get vim-trailing-whitespaces
+
+curl -SsL https://github.com/bronson/vim-trailing-whitespace/archive/master.tar.gz \
+ > vim-trailing-whitespace.tar.gz
+tar -xzf vim-trailing-whitespace.tar.gz
+rm vim-trailing-whitespace.tar.gz
+
+cd $restore
Please sign in to comment.
Something went wrong with that request. Please try again.