Skip to content

Instantly share code, notes, and snippets.

View arbianchi's full-sized avatar

Adina Bianchi arbianchi

View GitHub Profile
Bash / Terminal Commands
These are the basic commands for navigating directories in a Terminal or Git Bash window
Moving in directories
Change Directory
cd
Change to Root Directory
var wordList = ["laura", "donna", "james", "maddy", "shelly", "leo", "leland", "sarah", "bobby", "mike", "audrey", "dale", "ben", "jerry", "norma", "lucy", "andy", "nadine", "pete", "catherine", "hank", "albert", "gordon", "josie", "garland", "ed", "annie", "ronette"]
// var for randomly selected word from array
var chosenWord = "";
// letter in chosen word index
var letterInChosenWord = [];
// number blank variable
var numBlanks = 0;
var blanksAndSuccesses = [];
// tracker for wrong guesses
var wordList = ["laura", "donna", "james", "maddy", "shelly", "leo", "leland", "sarah", "bobby", "mike", "audrey", "dale", "ben", "jerry", "norma", "lucy", "andy", "nadine", "pete", "catherine", "hank", "albert", "gordon", "josie", "garland", "ed", "annie", "ronette"]
// var for randomly selected word from array
var chosenWord = "";
// letter in chosen word index
var letterInChosenWord = [];
// number blank variable
var numBlanks = 0;
var blanksAndSuccesses = [];
// tracker for wrong guesses
@arbianchi
arbianchi / game.js
Created June 9, 2017 19:07
Hangman Feedback
document.getElementById('instructions').innerHTML = 'Press any key to get started!';
var hangmanWords = ['blender', 'oven', 'stove', 'refrigerator', 'microwave', 'table', 'utensils', 'dishwasher', 'sink'];
var word = '';
var wrongChar = [];
var rightChar = [];
var rightCharIndex = [];
var triesLeft = 0;
@arbianchi
arbianchi / game.js
Created June 9, 2017 20:07
Hangman Feedback
var yourGuesses = [];
var possibleWords = ["tiki", "sunscreen", "umbrella", "surf", "beach", "sun", "rum"];
var gameWins = 0;
var secretWord = possibleWords[gameWins];
var letterCount = secretWord.length;
var mysteryDisplay = "";
var wordArray = secretWord.split("");
var displayArray = [];
var lives = 8;
var images = ["TikiMan1H6.png", "TikiMan1H5.png", "TikiMan1H4.png", "TikiMan1H3.png", "TikiMan1H2.png", "TikiMan1H1.png", "TikiMan1H0.png", "TikiMan1HB.png"];
@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 / push_unsolved_activities.sh
Created June 12, 2017 23:48
Push All Unsolved Activities for the Week
# SETUP:
# 1. sudo chmod +ox push_unsolved_activites.sh
# 2. Change 'activities' and 'classDir' paths to correspond to local directories.
# 3. Run the script from the directory where it is located: ./push_unsolved_activities.sh 06-ajax
if [[ -z "$1" ]]; then
echo "Please pass in the week name. Ex: 10-nodejs"
exit 1
else
week=$1
@arbianchi
arbianchi / push_unsolved_activities.sh
Last active June 13, 2017 00:04
Push All Unsolved Activities for the Week
# SETUP:
# 1. sudo chmod +x push_unsolved_activites.sh
# 2. Change 'activities' and 'classDir' paths to correspond to full path of local directories.
# 3. Run the script from the directory where it is located: ./push_unsolved_activities.sh 06-ajax
if [[ -z "$1" ]]; then
echo "Please pass in the week name. Ex: 10-nodejs"
exit 1
else
week=$1
@arbianchi
arbianchi / game.js
Last active June 14, 2017 22:41
Crystal Game Feedback
// ADINA:
// First, a couple notes on your index.html:
// The layout looks good but it might be nice to see everything on one screen (now I have to scroll down to see the crystals).
// The problem with linking to your js script file was that this linke:
// <script type="text/javascript" src="assets/javascript/game.js"></script>
// should always be placed directly before your closing </body> tag. This is because of the order in which the page loads.
$("#startButton").on("click", function() {
@arbianchi
arbianchi / game.js
Created June 17, 2017 15:17
jQuery game feedback
// ADINA: In order to avoid repeating this code, you could use a function like this:
// function crystalNumber() {
// return Math.floor((Math.random() * 12) + 1);
// }
// function targetScore() {
// return Math.floor((Math.random() * 120) + 19);
// }
// var crystals = {