View Gemfile
This file contains 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
gem 'bootstrap-sass' | |
gem 'jekyll-bootstrap-sass' |
View concur-config-example.yml
This file contains 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
# config.yml | |
sass: | |
style: compressed |
View concur-style-example.scss
This file contains 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
--- | |
# this is front matter here, so Jekyll can parse this file | |
# appropriately | |
--- | |
@import "main"; |
View concur-main-example.scss
This file contains 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 "colors" | |
$font-family-base: "Helvetica Neue", "Segoe UI", Arial, sans-serif; | |
@import "components/navbar"; | |
@import "pages/blog"; | |
@import "bootstrap"; | |
html { |
View cachedPokemonCall-3.js
This file contains 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
const request = require('request'); | |
const NodeCache = require('node-cache'); | |
const API_ENDPOINT = 'http://pokeapi.co/api/v2/pokemon/'; | |
const cache = new NodeCache(); | |
// accepts an endpoint (string) to query | |
// accepts a callback function to be called when the query is finished | |
function callEndpoint(endpoint, callback) { | |
request(endpoint, (error, response, body) => { | |
// if unsuccessful, pass the error to the callback function |
View cachedPokemonCall-2.js
This file contains 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
const request = require('request'); | |
const NodeCache = require('node-cache'); | |
const API_ENDPOINT = 'http://pokeapi.co/api/v2/pokemon/'; | |
const cache = new NodeCache(); | |
// try getting data from the cache first | |
cache.get(API_ENDPOINT, (err, data) => { | |
// return early if there's an error or data is available | |
if (err) return console.log(err); |
View cachedPokemonCall.js
This file contains 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
const request = require('request'); | |
const NodeCache = require('node-cache'); | |
const API_ENDPOINT = 'http://pokeapi.co/api/v2/pokemon/'; | |
const cache = new NodeCache(); | |
// try getting data from the cache first | |
cache.get('my-pokemon', (err, data) => { | |
// return early if there's an error or data is available | |
if (err) return console.log(err); |
View cacheExample.js
This file contains 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
const NodeCache = require('node-cache'); | |
const cache = new NodeCache(); | |
let data = { results: [] }; | |
// using the cache module to add an object to the cache | |
cache.set('my-pokemon', data, (err, success) => { | |
// success will be true if successful | |
}); |
View pokemonCall.js
This file contains 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
const request = require('request'); | |
const API_ENDPOINT = 'http://pokeapi.co/api/v2/pokemon/'; | |
request(API_ENDPOINT, (error, response, body) => { | |
console.log(body); | |
// { | |
// "count": 811, | |
// "previous": null, | |
// "results": [ | |
// { |
NewerOlder