Skip to content

Instantly share code, notes, and snippets.

View Danielshow's full-sized avatar
:octocat:
Changing the world one code at a time 👻🎉🎉🎊

Daniel Shotonwa Danielshow

:octocat:
Changing the world one code at a time 👻🎉🎉🎊
View GitHub Profile
import React, { Component } from 'react';
import logo from './logo.svg';
import { addTodo, deleteTodo } from "./action";
import { connect } from "react-redux";
import './App.css';
class App extends Component {
state = {
todo: '',
todos: []
export const Types = {
ADD_TODO: 'ADD_TODO',
DELETE_TODO: 'DELETE_TODO'
}
export const addTodo = (todo) => ({
type: Types.ADD_TODO,
payload: todo
})
import { Types } from './action'
const initialState = {
todos: []
}
const reducer = (state=initialState, action) => {
switch(action.type){
case Types.ADD_TODO: {
const id = state.todos.length + 1
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import reducer from './reducer'
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
const store = createStore(reducer);
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
state = {
todo: '',
todos: []
}
handleChange = (e) => {
this.setState({
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
state = {
todo: '',
todos: []
}
handleChange = (e) => {
this.setState({
import jwt from 'jsonwebtoken'
const verifyToken = (req, res) => {
const headers = req.headers['authorization']
if (!headers) {
// any error
}
const token = req.headers.authorization.split(' ')[1]
const user = jwt.verify(token, //secretkey)
req.user = user;
import { expect, should } from 'chai';
const url = '../index';
const testObject = {
emptyEmail: {
email: '',
password: 'tuij'
},
wrongEmailFormat: {
email: 'danielopeyemi*',
@Danielshow
Danielshow / index.html
Created April 10, 2018 18:28
Quote Generator
<link href="https://fonts.googleapis.com/css?family=Chicle|Kaushan+Script" rel="stylesheet">
<div class="container">
<div class='row'>
<div class='col-md-2 col-lg-3 col-sm-1'></div>
<div class='col-md-8 col-lg-6 col-sm-10 col-xs-12'>
<div class="card message">
<h1 class="text-center">Random Quote Generator</h1>
<div>
<i class="fa fa-quote-left" id='left'></i>
<h4 class='quoteMessage text-center'>Be a Programmer, It's the Best thing Ever</h4>