Skip to content

Instantly share code, notes, and snippets.

@cford-14
cford-14 / app.js
Created April 28, 2020 19:39
Express.js with Handlebars App
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var hbs = require('express-handlebars')
var indexRouter = require('./routes/index.js');
var aboutRouter = require('./routes/about.js');
var partnersRouter = require('./routes/partners');
@cford-14
cford-14 / Index of List App
Created April 8, 2020 19:12
List App connection errors in ListList component
import React from 'react';
import ReactDOM from 'react-dom';
import { Route, Link, BrowserRouter as Router, Switch } from 'react-router-dom';
import { Provider } from 'react-redux';
import { store } from './REDUX/store';
import './index.css';
import App from './App';
import { Manage } from './components/Delta/Manage';
import { NewList } from './components/Delta/NewList';
import { Share } from './components/Delta/Share';
@cford-14
cford-14 / group problem
Created February 6, 2020 20:10
group problem from Ch 6 of Elequent Javascript
class Group {
// Your code here.
constructor(group){
this.group = group;
}
add(num) {
let index = this.group.indexOf(num);
if (index === -1) {
this.group.push(num)
};
@cford-14
cford-14 / hangman.py
Created February 5, 2020 23:31
hangman.py
#Hangman
import random
#def hangman fuction
def hangman(spelling_word_list):
#if there are words on the spelling list, "welcome, do you want to play?"
if spelling_word_list:
print("Welcome to hangman!\n")
@cford-14
cford-14 / find_the_hat.js
Last active January 19, 2024 15:47
find the hat exercise
//https://gist.github.com/74bd26dd414b4fae14b218919d20d458
const prompt = require('prompt-sync')({sigint: true});
const hat = '^';
const hole = 'O';
const fieldCharacter = '░';
const pathCharacter = '*';
//define class