This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adina: As a general rule, don't use capital letters in file names. | |
//Despite redoing twitter, it is still erroring// | |
var fs = require('fs'); | |
var keys = require('./keys.js'); | |
var Twitter = require('twitter'); | |
var spotify = require('node-spotify-api'); | |
var omdb = require('omdb'); | |
var request = require('request'); | |
var input1 = process.argv[2]; | |
var input2 = process.argv.splice(3).join(" "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var twitterKeys = require('./keys.js'); | |
var command = process.argv[2]; | |
var userParameter = process.argv[3]; | |
var Twitter = require('twitter'); | |
var accessCodes = twitterKeys.twitterKeys; | |
var Spotify = require('node-spotify-api'); | |
var fs = require('fs'); | |
// To accomodate multi-word inputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MissionsController < ApplicationController | |
def index | |
# Gets list of unique mission type ids for current program | |
# Could be pulled out into a model method. | |
mission_type_ids = ( | |
current_company.missions_for_program(current_program).pluck("distinct(mission_type_id)") #+ | |
).uniq | |
# Gets mission types with IDs matching mission_type_ids. Could avoid multiple calls by using a join. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//Declare topics | |
var topics = ["Spongebob", "Patrick", "Rick and Morty", "Peter Griffin", "Stewie Griffin", "Quagmire"]; | |
//Make initial buttons | |
for (i=0; i<topics.length; i++) { | |
makeButton(topics[i]); | |
} | |
//Make form for new button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: What you did definitely works, but if you wanted to dynamically generate the input elements with javascript, this is how you would do it: | |
// var questions = [{ | |
// question: "What was the first full length CGI movie?", | |
// answers: ["A Bug's Life", "Monsters Inc.", "Toy Story", "The Lion King"], | |
// correctAnswer: "Toy Story" | |
// }, { | |
// question: "Which of these is NOT a name of one of the Spice Girls?", | |
// answers: ["Sporty Spice", "Fred Spice", "Scary Spice", "Posh Spice"], | |
// correctAnswer: "Fred Spice" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: What you did definitely works, but if you wanted to dynamically generate the input elements with javascript, this is how you would do it: | |
// var questions = [{ | |
// question: "What was the first full length CGI movie?", | |
// answers: ["A Bug's Life", "Monsters Inc.", "Toy Story", "The Lion King"], | |
// correctAnswer: "Toy Story" | |
// }, { | |
// question: "Which of these is NOT a name of one of the Spice Girls?", | |
// answers: ["Sporty Spice", "Fred Spice", "Scary Spice", "Posh Spice"], | |
// correctAnswer: "Fred Spice" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: This structure works but a constructor object would help you avoid repeating code. It would look something like this: | |
// var questions = []; | |
// function question(question, answers, correctAnswer) { | |
// this.question = question; | |
// this.answers = answers; | |
// this.correctAnswer = correctAnswer; | |
// questions.push(this); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ADINA: Using an array for storing questions/answers but a constructor object would help you avoid repeating code. It would look something like this: | |
// | |
// var questions = []; | |
// function question(question, answers, correctAnswer) { | |
// this.question = question; | |
// this.answers = answers; | |
// this.correctAnswer = correctAnswer; | |
// questions.push(this); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ADINA: Using an array for storing questions/answers but a constructor object would help you avoid repeating code. It would look something like this: | |
// var questions = []; | |
// function question(question, answers, correctAnswer) { | |
// this.question = question; | |
// this.answers = answers; | |
// this.correctAnswer = correctAnswer; | |
// questions.push(this); | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADINA: This structure works but a constructor object would help you avoid repeating code. It would look something like this: | |
// | |
// // var questions = []; | |
// // function question(question, answers, correctAnswer) { | |
// // this.question = question; | |
// // this.answers = answers; | |
// // this.correctAnswer = correctAnswer; | |
// // questions.push(this); | |
// // } | |
// |
NewerOlder