Quotes help make search much faster. Example: "Practice Makes Perfect"
Tuesday, May 21, 2013
Codecademy Sample Solution: Reading Date
$(function() {
// Put your firebaseRef.on call here!
firebaseRef.on("value", function(snap){
$("#result").html(JSON.stringify(snap.val()));
});
});
Codecademy Sample Solution: Writing Objects to Firebase
$(function() {
// Call firebaseRef.set here!
firebaseRef.set({
type: "fruit",
name: "apple",
price: 42.0
});
});
Codecademy Sample Solution: Writing Simple Data to Firebase
$(function() {
// Call firebaseRef.set here!
firebaseRef.set("someValue");
});
Codecademy Sample Solution: Initializing the Firebase JavaScript Library
<html>
<head>
<!-- Add your script tag here! -->
<script src="https://cdn.firebase.com/v0/firebase.js"></script>
</head>
<body style="padding: 15px; background-color: #FFFAD5; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;">
<img src="https://www.firebase.com/images/logo.png"></img>
</body>
</html>
Codecademy Sample Solution: AJAX
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4 && req.status == 200) {
console.log("Success!");
}
};
var url = "http://www.codecademy.com";
// Put your req.open and req.send calls here!
req.open("GET", url, true);
req.send();
Codecademy Sample Solution: Anonymous functions
setTimeout(function() {
console.log("The callback fired");
}, 500);
Codecademy Sample Solution: Functions are just objects
function myFunction() {
console.log("The callback fired");
}
function startTimer(func) {
func(myFunction, 500);
}
// Put the startTimer call here.
startTimer(setTimeout);
Codecademy Sample Solution: How to use a callback
function myFunction() {
// Put your console.log in here.
console.log("The callback fired")
}
setTimeout(myFunction, 500);
console.log("Am I the first message?");
Sunday, May 5, 2013
Codecademy Sample Solution: Adding the Parse SDK to your app
<html>
<head>
<!-- Add the Parse SDK here! -->
<script src="http://www.parsecdn.com/js/parse-1.1.15.min.js"></script>
</head>
<body>
</body>
</html>
Subscribe to:
Posts (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
function checkAnswerWrongPlace(ans, realanswer){ // This method compares two input strings representing a player's guess ("an...
-
#sample solution def colorful_conditions(): color = "blue" if color == "red": return "firs...
-
//sample solution //Here is the original card object var card1 = {"suit":"clubs", "rank": 8}; //Create a ...
-
//sample solution //Here is the original card object var card1 = {"suit":"clubs", "rank": 8}; //Create a...
-
# note: The instructions state to use "text.txt" but an error comes up stating that the file does not exist # as a work around, ...
-
function sumAll(arr) { var sorted = arr.sort(function(a, b){return a-b}); var sum = 0; for(var i=sorted[0]; i<=sorted[1]; i++){ ...
-
Instruction: Find the id of the flights whose distance is below average for their carrier. Sample Solution: SELECT id FROM flights AS f...
-
# Sample Solution # Import packages import numpy as np import pandas as pd # Read in transactions data transactions = pd.read_csv(...
-
# Sample Solution from song_data import songs import numpy as np q1 = np.quantile(songs, 0.25) #Create the variables q3 and interquarti...