Skip to content

Instantly share code, notes, and snippets.

Avatar

Adina Bianchi arbianchi

View GitHub Profile
View liri.js
// 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(" ");
@arbianchi
arbianchi / liri.js
Created Jul 31, 2017
LIRI hw feedback
View liri.js
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
@arbianchi
arbianchi / test.rb
Created Jul 5, 2017
Ruby on Rails Test - Adina Bianchi
View test.rb
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.
@arbianchi
arbianchi / app.js
Created Jun 28, 2017
Giphy Homework Feedback
View app.js
$(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
@arbianchi
arbianchi / app.js
Created Jun 26, 2017
Trivia Game Feedback
View app.js
// 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"
@arbianchi
arbianchi / app.js
Created Jun 24, 2017
Trivia Game Feedback
View app.js
// 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"
@arbianchi
arbianchi / game.js
Created Jun 24, 2017
Trivia Game Feedback
View game.js
// 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);
// }
@arbianchi
arbianchi / app.js
Created Jun 24, 2017
Trivia Game Feedback
View app.js
//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);
// }
@arbianchi
arbianchi / game.js
Created Jun 24, 2017
Trivia Game Feedback
View game.js
//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);
// }
@arbianchi
arbianchi / app.js
Created Jun 24, 2017
Trivia Game feedback
View app.js
// 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);
// // }
//