##JavaScript
- Install jshint and Node.js
wget https://raw.github.com/coolaj86/dotfiles/master/.jshintrc
then install node.js from http://nodejs.org/ or
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
finally do this:
npm install -g jshint
'pushd ~'
curl https://raw.github.com/coolaj86/dotfiles/master/.jshintrc > ~/.jshintrc
wget https://raw.github.com/coolaj86/dotfiles/master/.jshintrc
cat .jshintrc
https://gist.github.com/coolaj86/5889096
-
opening a file: on linux:
xdg-open index.html
on mac:open index.html
-
inside the main JS function, add
"use strict";
to tell jshint to use Version 5 of JavaScript -
make sure you have wget curl for linux:
sudo apt-get install wget curl
for mac:sudo chown -R whoami /usr/local/ brew install wget curl
-
install zshell: https://github.com/robbyrussell/oh-my-zsh for linux: sudo apt-get install zsh type "which zsh" it should say: /usr/bin/zsh type "chsh -s /usr/bin/zsh" it will prompt for your password then after that, close the terminal, and log out of ubuntu and then log back in and you should be good.
cmd option j
(mac) orctr shift j
while in chrome browser to open up console.
##Ruby
1. `j@ubuntu~$ gem install pry` => This goes to rubygems.org online to download the "pry" gemgem install rspec
in terminal to install rspec--
to run Rspec in terminal : rspec --color file_name_spec.rb
- Sinatra:
gem install sinatra sinatra-contrib
to install andgem list sinatra
to confirm it has been installed.
ruby file_name.rb -o 0.0.0.0
for Sinatra host
require ("./contact")
the./
part asks to look for the file contact in the current folder that you are in, or the folder where your current file where this line is written is saved. Ruby automatically knows it is looking for a .rb file, so you don't need to write the file extension. This is how you reference other files in your ruby file.
##Sublime Text
- Sublime Linter: We've installed Sublime Linter through sublime package Control, this will give us error check while we type:
http://wbond.net/sublime_packages/package_control/installation
https://github.com/SublimeLinter/SublimeLinter
-
ctrl /
auto comments everything that's high-lighted -
press
ctrl D
while one of the word is selected will automatically select the same word throughout the document.
##Terminal
1. oh-my-zsh: https://github.com/robbyrussell/oh-my-zshon linux machines- install zsh via "sudo apt-get install zsh"
to install
type which zsh
to confirm it is in your home directory (for mine it's in /usr/bin/zsh
)
then type chsh -s /usr/bin/zsh
, reopen terminal.. then viola!
-
Ctrl +
to zoom in on Linux machines (in apple:Cmd +
) -
Review of Terminal Commands: https://gist.github.com/screamingmunch/5800302
-
While in Terminal, to get to beginning of line:
Ctrl + a
; to get to end of line:Ctrl + e
*for Mac- if you're running into issues opening a non-mac program, press Appl Ctrl
then mouse click on the icon to open that way.
- Getting files from Terminal:
j@ubuntu:~$ mkdir Code/wk1d3
j@ubuntu:~$ pushd Code/wk1d3/
j@ubuntu:~/Code/wk1d3$ wget https://gist.github.com/coolaj86/983abc67071fbb5d0143/
raw/0ae2430c4bcdb1574d7e392c0e0ab2c65dc08974/instructors.csv
wget retrieves the file from your url and saves it into your
/Code/wk1d3 folder as "instructors.csv"
j@ubuntu:~/Code/wk1d3$ cat instructors.csv
running this will display the info in your csv file
-
in terminal:
ping -c 1 www.google.com
orping -c www.yahoo.com
will give you IP addresses. When you typeifconfig
you'll get a list of available interfaces. -
find .
in command line will return all the files in that folder
##Git
git init
git add .
git commit -m <message>
git push <remote> <branch>
git pull <remote> <branch>
git clone
git
git init
This initializes a new git repository (a git repository, not a github repository)
git add
This adds changes you have made to the git repository
git commit -m
- This commits (saves) the changes you've added to the repository
- The -m is to tell git you are going to write a message then you write this message
- You have to write a commit message to commit code
git push remote branch
- git push pushes your code to somewhere on the cloud (on the internet)
- remote is the web address of where you are pushing code
- branch is the name of the branch you are pushing to (for now, just origin)
git pull remote branch
- git pull pulls code down from the cloud (the internet)
- remote is still the web address
- branch is still the branch name
git clone
This copies a full repo from the cloud to your computer