Skip to content

Instantly share code, notes, and snippets.

View bdougie's full-sized avatar

Brian Douglas bdougie

View GitHub Profile
function () {}
@bdougie
bdougie / debug.rb
Last active January 26, 2018 05:45
# 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

The Main Content

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.

The "Help, I'm Stuck!" Meeting

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:

  1. Have them describe their understanding of the problem and what they’ve tried so far to resolve it.
  2. 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).
// 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]

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.

bar

Coffee Wiki

There are two ways to make coffee:

To Share

  1. Grind 6 scoops of beans
  2. Place the metal and paper filter in the Chemex
  3. Pour water in until it reaches a half inch from the brim of the metal filter.
  4. Stir water and beans gently
  5. Wait
@bdougie
bdougie / line.go
Created February 25, 2016 18:59
Why does compare note work?
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
@bdougie
bdougie / testHook.js
Last active January 29, 2016 01:18
My first hook.io microservice
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;
@bdougie
bdougie / node-gyp.js
Created July 28, 2015 15:56
node gyp rebuild error
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',
$ 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