Skip to content

Instantly share code, notes, and snippets.

View fresh5447's full-sized avatar

Douglas Walter fresh5447

View GitHub Profile
// different types of scenes
// choose path
// game over scene
// battle scene
// Game { who the user is}
// World
- title
- scense (this will be a lookup by id to Scene)
@fresh5447
fresh5447 / es6ws.js
Created April 26, 2017 01:33
Some code along examples comparing ES5 to ES6
// write a funciton, that can get a name
// passed as a parameter. Returns hello to
// that name.
function greeting(name){
return "Hello, " + name + "!"
};
// Arrow function
const greeting2 = (name) => {
// chai expect http://chaijs.com/api/bdd/
// jokes api http://api.icndb.com/jokes/random/100
var chai = require('chai');
var expect = require('chai').expect;
var Joker = require('../jokes');
describe('/Joker constructor', function(){
var j = new Joker();
@fresh5447
fresh5447 / data.json
Created April 13, 2017 22:21
Data for Jokes TDD
{ "type": "success", "value": [ { "id": 205, "joke": "It is scientifically impossible for Chuck Norris to have had a mortal father. The most popular theory is that he went back in time and fathered himself.", "categories": [] }, { "id": 186, "joke": "Fear is not the only emotion Chuck Norris can smell. He can also detect hope, as in "I hope I don't get a roundhouse kick from Chuck Norris."", "categories": [] }, { "id": 567, "joke": "Code runs faster when Chuck Norris watches it.", "categories": ["nerdy"] }, { "id": 286, "joke": "The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death.", "categories": [] }, { "id": 515, "joke": "Chuck Norris compresses his files by doing a flying round house kick to the hard drive.", "categories": ["nerdy"] }, { "id": 312, "joke": "Jesus can walk on water, but Chuck Norris can walk on Jesus.", "categories": [] }, { "id": 47, "joke": "There is no theory of evolution, just a list of creatures Chuck Norris allows to live.", "categ
import React, { Component } from 'react';
import DropDown from './DropDown';
import logo from './logo.svg';
import './App.css';
import BasicRatesTable from './BasicRatesTable';
import LossTable from './LossTable';
class App extends Component {
constructor(props){
@fresh5447
fresh5447 / starwars.js
Last active April 6, 2017 01:14
Each endpoint returns a different Character. Here we are using Promise.all to return the data from 5 endpoints.
const Promise = require('bluebird');
const fetch = require('node-fetch');
let allData = [];
const getFirstChar = () =>
fetch('http://swapi.co/api/people/1')
.then(blob => blob.json())
.then(data => data)
.catch(e => e);
@fresh5447
fresh5447 / bballAnswers.js
Last active March 30, 2017 19:34
Solutions for the bball questions
var bballPlayers = [
{ first: 'Carlos', last: 'Beltran', homeruns: 421, retired: false },
{ first: 'Ken', last: 'Griffey Jr', homeruns: 630, retired: true },
{ first: 'Hank', last: 'Aaron', homeruns: 755, retired: true },
{ first: 'Ediwn', last: 'Encarnacion', homeruns: 310, retired: false },
{ first: 'Alex', last: 'Rodriguez', homeruns: 696, retired: true },
{ first: 'Willie', last: 'Mays', homeruns: 660, retired: true },
{ first: 'Jim', last: 'Thome', homeruns: 612, retired: true },
{ first: 'Sammy', last: 'Sosa', homeruns: 609, retired: true },
{ first: 'Babe', last: 'Ruth', homeruns: 714, retired: true },
@fresh5447
fresh5447 / bballQuestions.js
Created March 30, 2017 19:30
Using array methods with Baseball data
const bballPlayers = [
{ first: 'Carlos', last: 'Beltran', homeruns: 421, retired: false },
{ first: 'Ken', last: 'Griffey Jr', homeruns: 630, retired: true },
{ first: 'Hank', last: 'Aaron', homeruns: 755, retired: true },
{ first: 'Ediwn', last: 'Encarnacion', homeruns: 310, retired: false }
{ first: 'Alex', last: 'Rodriguez', homeruns: 696, retired: true },
{ first: 'Willie', last: 'Mays', homeruns: 660, retired: true },
{ first: 'Jim', last: 'Thome', homeruns: 612, retired: true },
{ first: 'Sammy', last: 'Sosa', homeruns: 609, retired: true },
{ first: 'Babe', last: 'Ruth', homeruns: 714, retired: true },
@fresh5447
fresh5447 / arrayCardio.js
Last active March 30, 2017 15:46 — forked from johotpocket/array cardio 04
js-30 array cardio day 4
const inventors = [
{ first: 'Albert', last: 'Einstein', year: 1879, passed: 1955 },
{ first: 'Isaac', last: 'Newton', year: 1643, passed: 1727 },
{ first: 'Galileo', last: 'Galilei', year: 1564, passed: 1642 },
{ first: 'Marie', last: 'Curie', year: 1867, passed: 1934 },
{ first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 },
{ first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 },
{ first: 'Max', last: 'Planck', year: 1858, passed: 1947 },
{ first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 },
@fresh5447
fresh5447 / array cardio 04
Created March 30, 2017 15:45 — forked from johotpocket/array cardio 04
js-30 array cardio day 4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Array Cardio 💪</title>
</head>
<body>
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
<script>
// Get your shorts on - this is an array workout!