Skip to content

Instantly share code, notes, and snippets.

View arbianchi's full-sized avatar

Adina Bianchi arbianchi

View GitHub Profile
@arbianchi
arbianchi / salamander-toes.js
Created June 10, 2017 14:48
Hangman feedback
// ADINA: I noticed you have categories with a name, words, and hint which you have to keep track of by juggling the index of a bunch of different arrays. This is a great opportunity to use a constructor function, which would look like this:
//
// function category( words, hint ) {
// this.words = words;
// this.hint = hint;
// }
// var Films = new category( ["the-matrix", "scarface", "wonder-woman", "finding-dory", "zootopia"], ["Neo", "Cocaine, guns, and a whole lotta swearing", "Feminist superhero", "Ellen's film about a forgetful fish", "Disney's animal cops"] );
// Then you could simply use Films.words to get your array of words, or Films.hint
@arbianchi
arbianchi / app.js
Created June 24, 2017 15:28
Trivia Game Feedback
//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 / liri.js
Created August 1, 2017 01:04
LIRI Feedback
// 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 July 31, 2017 22:27
LIRI hw feedback
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 July 5, 2017 22:13
Ruby on Rails Test - Adina Bianchi
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 June 28, 2017 23:06
Giphy Homework Feedback
$(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 June 26, 2017 21:07
Trivia Game Feedback
// 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 June 24, 2017 17:29
Trivia Game Feedback
// 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 June 24, 2017 15:47
Trivia Game Feedback
// 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 / game.js
Created June 24, 2017 15:16
Trivia Game Feedback
//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);
// }