Skip to content

Instantly share code, notes, and snippets.

What is homebrew?
Homebrew is a package management software, which makes it easy to install open-source software on Macs.
What is git and why do we need it?
Git is a version control system.
It allows us to see the changes made to each version, who made the changes, and when they were made, making it easy to find bugs.
What is rbenv?
RBENV is short for Ruby environment. It allows user to work with different versions of Ruby.
What are the three ways we can include css in an html file? Provide an example of each
External stylesheet - create a new .css file and put all css commands in that file. Include a link in .html file to the .css file
Internal stylesheet - put all css commands in the <head> section of .html file between <style>
Inline - write css command in the html. e.g. <h1 style="color: orange">Title</h1>
What's the difference between classes and id for selectors? When would we use each? Provide an example of each
Classes can refer to different selectors. You would use classes when you want to target selectors with similar characteristics. Classes are denoted with a "." in css. <img src="../starter-code/images/startup-matchmaker-deliverable.png" alt="Startup Matchmaker" class="portfolio">
Ids are only used once and so are specific to one selector. Ids are denoted with a "#" in css. <img src="http://i.imgur.com/ZtkNn8G.jpg" alt="Joe" id="profile">
@adaau
adaau / gist:a737c5efda5e4a90378d
Created September 24, 2015 01:36
Ada assessment CSS JS
CSS
1. What are the four main component when considering css specificity?
Style attribute (specified in the html)
ID
Class
Element
2. If I have 1)ul#nav li.active a and 2)div.navbar li.active a.social which will have more specificity?
(1) will have more specificity
@adaau
adaau / gist:a285ae8427a8a27a0883
Created September 25, 2015 02:13
Ada Assessment_JS Functions and Objects
HTML
Take a piece of paper and draw the structure of this website
Functions and Scope
Describe what a function is/does?
A function allows you to run a set of instructions.
How do I declare a function? and how do I run a function?
function functionName(parameters) {
do something
1. What is DOM?
Document Object Model
It serves as a platform to join HTML, CSS, and Javascript, allowing interaction with objects.
2. Why do we need it?
To allow the languages to work together and make website dynamic.
3. What is the major difference between document.getElementsByClassName("some-class") and document.getElementById("some-id") in terms of what it returns?
ByClassName: returns all the elements that have "some-class" class name
@adaau
adaau / gist:76cdb53ee35b7c5bdbd4
Created October 6, 2015 02:21
Assessment_JQuery
/*1. How do we include jQuery into our html projects? What are the pros and cons of each option?
Add a link in html to jQuery library.
2. What is the first thing to do in your javascript to start using jQuery?
Put a $ in front of jQuery terms
3. Given the following html use jQuery code solve the following questions
*/
<body>
<div>
Numbers & Strings
var numbers = [1,12,4,18,9,7,11,3,101,5,6];
var strings = ['this','is','a','collection','of','words'];
// array.reduce - find the largest number //
var largestValue = numbers.reduce(function(a, b){
if (a > b) {
return a
}
@adaau
adaau / gist:37759af9d3d102bba357
Created October 7, 2015 05:49
Assessment_13digits
var longNumberStr = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450";
@adaau
adaau / gist:620ca2fe4ae2b32a7870
Created October 8, 2015 03:06
Assessment - JS arrays
Data types
Explain the characteristics of each data type
What are the default falsey/truthy values?
Provide an example of its use that showcases why/when may be useful to use them
String
Something that is read as text, can be letters, digits, or symbols (escape). Put in quotes.
Default falsey:
Default truthy:
@adaau
adaau / gist:59c88cc4a25b34814820
Created October 15, 2015 07:35
WDI Project 1: Yamslam - 2 code snippets
// Player "keeps" dice by clicking on dice. Can make active again by clicking again.
var diceClick = function() {
$(".dice").on("click", function(event) {
var dice = $(this);
var value = parseInt(dice.children().attr('data-value'));
if (dice.css("opacity") == OPACFULL) {
dice.css("opacity", DICEOPACHALF);
dice.children().addClass("dice-kept");
game.keepDice(value);
checkCombo();