rails new app-name --database=postgresql -BT
--database=postgresql-> Use postgres for database-B-> skip initial bundle install-T-> skip test suite (we're using rspec)
rails g controller welcome
| INTRO to BOOTSTRAP | |
| 1- Build a bootstrap based web page using bootstrap grid system | |
| 2- Learn about bootstrap components | |
| 3- Dive into form components | |
| 4- Discover how to make a page responsive | |
| 5- Places to get unique bootstrap templates |
| def num_islands(grid) | |
| return 0 if not grid | |
| result = 0 | |
| grid.length.times do |i| | |
| grid[0].length.times do |j| | |
| if grid[i][j] == 1 | |
| result += 1 | |
| extend(grid,i,j) | |
| end | |
| end |
| function asyncFunc() { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| const result = Math.random(); | |
| result > 0.5 ? resolve(result) : reject('Oppps....I cannot calculate') | |
| }, 1) | |
| }); | |
| } | |
| for (let i=0; i<10; i++) { |
| license: mit |
| license: mit |
| license: mit |
| license: mit |
| license: mit |
| // Dhruven | |
| // In the interview, I put myself in a rabbit hole | |
| // with no possible solution | |
| // | |
| // What I was trying to do is to pass the arguments from the first | |
| // function to the second function. | |
| // | |
| // The problem is the second function is return as a value | |
| // therefore it is an independent function and there is no way for it to accept | |
| // a value... The value needs to be passed as an argument by the executed function |