Skip to content

Instantly share code, notes, and snippets.

require 'pry'
# You're given a vector of vectors of words, e.g.:
# [['quick', 'lazy'], ['brown', 'black', 'grey'], ['fox', 'dog']].
#
# Write a generalized function that prints all combinations of one word from the first vector, one word from the second vector, etc.
# The solution may not use recursion.
#
# NOTE: the *number of vectors* and number of elements within each vector may vary.
require "rails_helper"
describe Api::V1::LessonSupplementsController do
describe "#show" do
let(:desired_response) do
{
lessonSupplement: {
id: lesson_supplement.id,
title: lesson_supplement.title,
type: lesson_supplement.type,
{
"name": "testing-react-components",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
var path = require('path');
module.exports = function(config) {
config.set({
// use the PhantomJS browser
browsers: ['PhantomJS'],
// use the Jasmine testing framework
frameworks: ['jasmine'],

AJAX (reading)

The 4 main steps of AJAX

  1. DOM (Document Object Model) Event Occurs
  • An interaction occurs on the webpage (#div link or button is clicked)
  • The JS running on the page has an event listener for the interaction $("#new-fortune").on("click", function(event) {
  • event.preventDefault() prevents the page from executing the button/link's function within the event listener function
  1. The HTTP Request Occurs through AJAX

Step 1. #src/components/App.js

import React from 'react';
import PlaylistCollection from './PlaylistCollection'

class App extends React.Component {
  constructor(props) {
    super(props);
  };
@smkopp92
smkopp92 / atom_shortcuts.md
Last active July 26, 2017 20:28
A guide for coding efficiency

#Atom Shortcuts Shamelessly stolen borrowed from DRod who shamelessly stole borrowed from Christina

##Settings

Access settings with cmd + ,

###Themes