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
@Danielshow
Danielshow / index.html
Last active April 10, 2018 17:07
Wikipedia Viewer
<div class="container" id="form">
<div class="wiki mb-4"> Wikipedia Search Engine</div>
<form class="text-center">
<input id="txt_name" type="text" class="form-control" placeholder="Search Wiki or Type URL" autofocus onkeypress="return runScript(event)" />
<p type="submit" class="btn btn-primary mt-2 mr-4" id="search">Submit</p>
<a href="https://en.wikipedia.org/wiki/Special:Random" target="_blank" button class="btn btn-default mt-2 random">Random Article</a>
</form>
<p class="text-center mt-4 dan"> Designed by DanielShow</p>
</div>
<div class="container">
@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>
import { expect, should } from 'chai';
const url = '../index';
const testObject = {
emptyEmail: {
email: '',
password: 'tuij'
},
wrongEmailFormat: {
email: 'danielopeyemi*',
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 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 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 { Types } from './action'
const initialState = {
todos: []
}
const reducer = (state=initialState, action) => {
switch(action.type){
case Types.ADD_TODO: {
const id = state.todos.length + 1
export const Types = {
ADD_TODO: 'ADD_TODO',
DELETE_TODO: 'DELETE_TODO'
}
export const addTodo = (todo) => ({
type: Types.ADD_TODO,
payload: todo
})
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: []