Skip to content

Instantly share code, notes, and snippets.

View cziem's full-sized avatar
:octocat:
Coding

Favour George C cziem

:octocat:
Coding
View GitHub Profile
@cziem
cziem / webpack.config.js
Created November 3, 2018 21:29
webpack custom configuration for mern stack application
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: "./client/src/index.js",
output: {
path: path.resolve(__dirname, "./dist"),
filename: "index-bundle.js"
},
module: {
@cziem
cziem / eslintrc.json
Created November 3, 2018 14:43
eslintrc configurations
{
"extends": [
"eslint:recommended"
],
"plugins": [
"react",
"jsx-a11y",
"import"
],
"parserOptions": {
@cziem
cziem / calc.js
Created September 15, 2018 23:03
Calc file
const assert = require('assert');
const { add, substract, divide, multiply, validateNumbers } = require('./operations')
it ('correctly calculates the sum of 1 and 3', () => {
assert.equal(add(1, 3), 4);
})
it ('correctly calculates the difference of 33 and 3', () => {
assert.equal(substract(33, 3), 30);
})
@cziem
cziem / operations.js
Created September 15, 2018 23:01
Operations.js
const add = (x, y) => (+x) + (+y);
const substract = (x, y) => (+x) - (+y);
const multiply = (x, y) => (+x) * (+y);
const divide = (x, y) => (+x) / (+y);
const validateNumbers = (x, y) => {
if (isNaN(x) || isNaN(y)) {
return false;
}
return true
@cziem
cziem / mocha-test.js
Created September 15, 2018 22:59
Testing with Mocha
const assert = require('assert');
const { add, substract, divide, multiply, validateNumbers } = require('./operations')
it ('correctly calculates the sum of 1 and 3', () => {
assert.equal(add(1, 3), 4);
})
it ('correctly calculates the difference of 33 and 3', () => {
assert.equal(substract(33, 3), 30);
})
@cziem
cziem / contact-us.scss
Created September 13, 2018 17:44
Contact Us Section
.contact_us {
display: flex;
height: auto;
background: #1d1e22;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.contact_us h3 {
@cziem
cziem / media-query.css
Created September 13, 2018 17:42
Product page media-query
@media (max-width: 680px) {
header {
flex-direction: column !important;
nav {
margin-top: 1rem;
}
}
.course, .pricing {
height: auto;
@cziem
cziem / index.html
Created September 13, 2018 17:38
Product page home
<div class="main">
<header id="header" class="header">
<div class="logo">
<img id="header-img" src="https://2rbfd03pmmcu3pkvqf1xl71z-wpengine.netdna-ssl.com/wp-content/uploads/2017/01/logo.png" alt="CW logo"> <span>courseWare</span>
</div>
<nav id="nav-bar">
<ul>
<li>
<a class="nav-link" href="#courses">Courses</a>
@cziem
cziem / index.html
Created September 13, 2018 17:37
Product page home
<div class="main">
<header id="header" class="header">
<div class="logo">
<img id="header-img" src="https://2rbfd03pmmcu3pkvqf1xl71z-wpengine.netdna-ssl.com/wp-content/uploads/2017/01/logo.png" alt="CW logo"> <span>courseWare</span>
</div>
<nav id="nav-bar">
<ul>
<li>
<a class="nav-link" href="#courses">Courses</a>
@cziem
cziem / form-validation.js
Created September 8, 2018 20:18
Form validation in React's Style
// create state
const formDetails = {
user: {
fullname: "",
username: "",
email: "",
password: "",
rePassword: "",
occupation: ""
},