This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import a library to help create a component | |
import React, { Component } from 'react'; | |
import { Text, View } from 'react-native'; | |
import axios from 'axios'; | |
// ES6 Class Component | |
class AlbumList extends Component { | |
// initializing component level state | |
// to get access to data and rerender | |
// this.state.albums equal to empty array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>The Terminal - Your Source for Fact-Based News</title> | |
<link href="https://fonts.googleapis.com/css?family=Amatic+SC|Raleway:100,200,600,700" rel="stylesheet"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<nav class="navigation"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output = document.getElementById('output'); | |
var myData = '[{"question":"What color is an apple?","answers":["Blue","Red","Purple"],"correct":1},{"question":"What color is grass?","answers":["Green","Red","Purple"],"correct":0}]' | |
var myObj = JSON.parse(myData); | |
for (var i in myObj) { | |
output.innerHTML += myObj[i].question + '? <br>'; | |
} | |
output.innerHTML = myObj[0].question; | |
console.log(myObj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set seatingCapacity(newCapacity) { | |
if (typeof newCapacity === 'number') { | |
this._seatingCapacity = newCapacity; | |
console.log(`${newCapacity} is valid input.`); | |
} else { | |
console.log(`Change ${newCapacity} to a number.`) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var images = [ | |
{ height: '34px', width: '39px' }, | |
{ height: '54px', width: '19px' }, | |
{ height: '83px', width: '75px' }, | |
]; | |
var heights; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates an object that can be decremented or incremented. | |
// Note that value can never be changed without using | |
// increment or decrement. This illustrates a use of closure | |
// the increment, decrement, getValue functions have access | |
// to value since functions inherit their outer scope. | |
// | |
// But note that there's no way to modify value except by | |
// using the increment and decrement functions. Thus, | |
// closures can be used to enforce privacy. | |
function getCounter(value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('A model class can update one record', (done) => { | |
assertName(User.findOneAndUpdate(joe._id, { name: 'Bill' }), done); | |
}); | |
it('A model class can find a record with an Id and update', (done) => { | |
assertName(User.findByIdAndUpdate(joe._id, { name: 'Bill' }), done); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isNightTime = true; | |
if (isNightTime) { | |
console.log('Turn on the lights!'); | |
} else { | |
console.log('Turn off the lights!'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= require templates/modules/dvic_card_gallery | |
//= require templates/modals/exit_interstitial | |
//= require application/optimizely-metrics | |
//= require templates/modals/dvic_modal_card_gallery | |
//= require templates/modals/dvic_modal_card_gallery | |
/* jshint:false */ | |
(function(exports) { | |
"use strict"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Tooltip from "../Widgets/Tooltip"; | |
import BackupPaymentBlurb from "./BackupPaymentBlurb"; | |
import CardPayment from "./CardPayment"; | |
import {normalizeCreditCard} from '../../lib/Format'; | |
import errorStrings from '../../assets/strings/errors.json'; | |
import store from '../../store'; | |
import PaymentMethodsFromWallet from './PaymentMethodsFromWallet'; | |
import config from '../../config'; |