$ gem install rails-api
$ rails-api new your_app
$ cd your_app
$ rails g scaffold stuff title:string
$ rake db:migrate
$ rails s
# you will see an empty array, but you once you
# create data you will see it render to JSON
"""""""""""""""""""""" | |
"" Vundler Boiler """" | |
"""""""""""""""""""""" | |
set nocompatible " be iMproved, required | |
filetype off " required | |
filetype plugin on " nercommenter | |
" Word wrap | |
set wrap | |
set textwidth=80 |
Brians-MBP:robotskirt bdoug$ node-gyp rebuild | |
gyp info it worked if it ends with ok | |
gyp info using node-gyp@2.0.2 | |
gyp info using node@0.12.0 | darwin | x64 | |
gyp info spawn python | |
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py', | |
gyp info spawn args 'binding.gyp', | |
gyp info spawn args '-f', | |
gyp info spawn args 'make', | |
gyp info spawn args '-I', |
var url = require('url') ; | |
// A simple hello world microservice | |
// Click "Deploy Service" to deploy this code | |
// Service will respond to HTTP requests with a string | |
module['exports'] = function helloWorld (hook) { | |
// hook.req is a Node.js http.IncomingMessage | |
var host = hook.req.host; | |
// hook.res is a Node.js httpServer.ServerResponse | |
// Respond to the request with a simple string | |
var queryObject = url.parse(hook.req.url,true).query; |
func removeFromLine(person string, line []string) []string { | |
for i, p := range line { | |
match, _ := regexp.MatchString(p, strings.ToLower(person)) | |
if match { | |
line = append(line[:i], line[i+1:]...) | |
} | |
} | |
return line |
Create a JSBin a loding progress bar. You can use basic html, css, and if needed some JavaScript. You will need to animate the progress bar on page load.
Similar but not exactly like this.
// Using a loop filter the following items array to return only numbers that are divisible by 2 evenly. | |
// Extra Credit: How would you do this without a loop. | |
items = [2, 3, 6, 5,7, 22] |
This is where we carry out the plan from the first step. This can take a lot of different forms depending on where the student is and what they need.
This is a common type of meeting when the student is stuck on something they’ve been working on and are trying to figure out how to get things working again. This is a great opportunity to pair program on debugging skills, walking through the problem solving steps together. Sometimes as a mentor you’ll know what the problem is right away, and sometimes you’ll be just as stumped as the student, but either way walking through a debugging process is very helpful. The process might look like this:
- Have them describe their understanding of the problem and what they’ve tried so far to resolve it.
- Confirm the problem together and have them walk through recreating it slowly to confirm that what they think is the problem is actually the problem (it often isn’t).
# the problem is return the wrong answer, set a breakpoint to find out what is wrong | |
def powersOfTwo(n) | |
newArr = [] | |
(0..n).to_a.each_with_index do |x, i| | |
# set a print to see what s happening | |
newArr.push(2*i) | |
end | |
newArr |