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 Twitter = require('twitter'); | |
var config = require('./config.js'); | |
var T = new Twitter(config); | |
// Set up your search parameters | |
var params = { | |
q: '#nodejs', | |
count: 10, | |
result_type: 'recent', | |
lang: 'en' |
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 the built in 'assertion' library | |
var assert = require('assert'); | |
// Create a group of tests about Arrays | |
describe('Array', function() { | |
// Within our Array group, Create a group of tests for indexOf | |
describe('#indexOf()', function() { | |
// A string explanation of what we're testing | |
it('should return -1 when the value is not present', function(){ | |
// Our actual test: -1 should equal indexOf(...) | |
assert.equal(-1, [1,2,3].indexOf(4)); |
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 the built in 'assertion' library | |
var assert = require('assert'); | |
// Create a test suite (group) called Math | |
describe('Math', function() { | |
// Test One: A string explanation of what we're testing | |
it('should test if 3*3 = 9', function(){ | |
// Our actual test: 3*3 SHOULD EQUAL 9 | |
assert.equal(9, 3*3); | |
}); | |
// Test Two: A string explanation of what we're testing |
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
cToF = function(celsius) { | |
if(!Number.isInteger(celsius)) return undefined; | |
return celsius * 9 / 5 + 32; | |
} | |
fToC = function(fahrenheit) { | |
if(!Number.isInteger(fahrenheit)) return undefined; | |
return (fahrenheit - 32) * 5 / 9; | |
} |
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 convert = {}; | |
convert.cToF = function(celsius) { | |
if(!Number.isInteger(celsius)) return undefined; | |
return celsius * 9 / 5 + 32; | |
} | |
convert.fToC = function(fahrenheit) { | |
if(!Number.isInteger(fahrenheit)) return undefined; | |
return (fahrenheit - 32) * 5 / 9; |
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 convert = require('../app.js') | |
let assert = require('assert'); | |
describe('Temperature Conversion', function() { | |
describe('cToF', function() { | |
it('should convert -40 celsius to -40 fahrenheit', function() { | |
assert.equal(-40, convert.cToF(-40)); | |
}); | |
it('should convert 0 celsius to 32 fahrenheit', function() { | |
assert.equal(32, convert.cToF(0)); |
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
body { | |
font-family: 'Open Sans', sans-serif; | |
} | |
.card { | |
width: 150px; /* Set width of cards */ | |
display: flex; /* Children use Flexbox */ | |
flex-direction: column; /* Rotate Axis */ | |
border: 1px solid #EF9A9A; /* Set up Border */ | |
border-radius: 4px; /* Slightly Curve edges */ |
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
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet"> | |
<div class="card"> | |
<div class="card-header">Night</div> | |
<div class="card-main"> | |
<i class="material-icons">hot_tub</i> | |
<div class="main-description">Hot Tub</div> | |
</div> | |
</div> |
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 request = require('request'); | |
let apiKey = '*****************************'; | |
let city = 'portland'; | |
let url = `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}` | |
request(url, function (err, response, body) { | |
if(err){ | |
console.log('error:', error); | |
} else { |
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 request = require('request'); | |
let apiKey = '***********************************'; | |
let city = 'portland'; | |
let url = `http://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${apiKey}` | |
request(url, function (err, response, body) { | |
if(err){ | |
console.log('error:', error); | |
} else { |
OlderNewer