⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arrayOfLight = function(positiveNumber){ | |
if (positiveNumber < 0 ) { | |
alert("Number must be a positive"); | |
} else { | |
var result = []; | |
for (i=0; i <= positiveNumber;i++) { | |
result[i] = i; | |
} | |
console.log(result); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Why is this broken? | |
// Has the second variable assignment mispelling the variable name. | |
var mySuperAwesomeVariableName = "Ted Mosby"; | |
mysuperAwesomeVariableName = "BATMAN!"; | |
console.log(mySuperAwesomeVariableName); | |
// What's missing? How does JS interpret empty line endings? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THE TRAGEDY OF HAMLET, PRINCE OF DENMARK | |
by William Shakespeare | |
Dramatis Personae | |
Claudius, King of Denmark. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
def separating_logic(arr) | |
return arr if arr.length == 1 | |
mid_point = arr.length / 2 | |
left_half = arr[0,mid_point] | |
right_half = arr[mid_point, arr.length] | |
# binding.pry | |
sorting_algorithm(separating_logic(left_half),separating_logic(right_half)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant [day_2]> irb | |
2.1.3 :001 > puts "hello" | |
hello | |
=> nil | |
2.1.3 :002 > "khurram".reverse | |
=> "marruhk" | |
2.1.3 :003 > ramon | |
NameError: undefined local variable or method `ramon' for main:Object | |
from (irb):3 | |
from /usr/local/rvm/rubies/ruby-2.1.3/bin/irb:11:in `<main>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def method_fb(s, f) | |
s.upto(f) { |x| | |
puts e(x) | |
} | |
end | |
def method_e(y) | |
if div_3?(y) && div_5?(y) | |
"FizzBuzz" | |
elsif div_5?(y) |