Skip to content

Instantly share code, notes, and snippets.

@thatguyintech
thatguyintech / gist:5a17282adb84b4120ab0
Created April 8, 2015 01:24
Student Submission Cucumber testing currently depends on amazon s3 set-up and internet connection, how do we separate them?
# student_submission.feature
Feature: upload a project
As a proud student
So that I can upload my awesome project
I want to submit my project with the required submission details
Background: course exists and is ready for submissions
Given I am a Student
# output how many paired neighbors can be smushed, ignoring 0s
def rowCount(arr):
if len(arr) > 0:
count = 0
prev = arr[0]
for i in range(1, len(arr)):
curr = arr[i]
if curr == 0:
continue
if curr == prev:
def updateBoard(board, click):
row, col = click
# 1. click on a mine, the game is over
if board[row][col] == 'M':
board[row][col] = 'X'
return board
adjacentMines = countMines(board, click)
counter = 0
def inorder(node):
if node:
inorder(node.left)
visit(node)
inorder(node.right)
def visit(node):
node.label = counter
# add a word to an existing trie, recursively
def addWord(word, trie):
# non-base case
if word:
letter, rest = word[0], word[1:]
if letter not in trie:
trie[letter] = {}
addWord(rest, trie[letter])
belongs_to :user, counter_cache: true
belongs_to :user, counter_cache: true
belongs_to :user, counter_cache: true
# answer.rb
class Answer < ApplicationRecord
belongs_to :user, counter_cache: true
end
# user.rb
class User < ApplicationRecord
has_many :answers
end

Magoosh Support API Documentation

Authentication

All requests should include a 'Authorization' header with an API key which will be provided. Headers['Authorization'] = "Token token=abcabcabc"

If you don't have a token, email zack@magoosh.com to get one!

All responses will be provided in JSON format.