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 / handler.js
Created August 17, 2019 12:48
contrived example of working with mongoose populate
const { Post, Author } = require('./models/post.schema')
const { Poem, User } = require('./models/poem.schema')
// Then for the post, you can run a mongoose populate like so...
const getPosts = async (req, res) => await Post.find({}).populate('author')
// Then for the poem, you want to run a mongoose populate like so...
const getPoems = async (req, res) => await Poem.find({}).populate({
path: 'author',
model: 'User'
@cziem
cziem / vscode-settings.json
Created July 25, 2019 14:45
My VsCode Settings
{
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"editor.multiCursorModifier": "ctrlCmd",
"editor.wordWrap": "on",
"editor.fontFamily": "Fira Code iScript",
"editor.fontLigatures": true,
"terminal.integrated.fontFamily": "'Fira Code iScript'",
"emmet.includeLanguages": {
"ejs": "html",
@cziem
cziem / payCard.html
Last active July 15, 2019 16:53
PayCard Functionality
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-eqX-UA-Compatible content="ie=edge" />
<title>Mini App</title>
<style>
body {
margin: 0;
@cziem
cziem / settings.json
Last active June 13, 2019 14:58
Setup your vscode with stylish fonts
{
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"editor.multiCursorModifier": "ctrlCmd",
"editor.wordWrap": "on",
"editor.fontFamily": "Fira Code iScript",
"editor.fontLigatures": true,
"terminal.integrated.fontFamily": "'Fira Code iScript'",
"emmet.includeLanguages": {
"ejs": "html",
@cziem
cziem / old-way.html
Created April 10, 2019 09:10
Old way
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>CSS Flexbox : It's all in the box (part 1)</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
@cziem
cziem / bookr.css
Created January 30, 2019 20:53
Style rules for the Bookr application built with GraphQL and Apollo Client
@import url('https://fonts.googleapis.com/css?family=Nunito');
* {
margin: 0;
padding: 0;
}
body {
background: #eee;
font-family: 'Nunito', sans-serif;
@cziem
cziem / main.js
Created November 12, 2018 10:24
a full version of the main.js file
const nav = document.querySelector('nav')
let navTop = nav.offsetTop
const stickyNav = () => {
if (window.scrollY >= navTop) {
document.body.classList.add('fixed_nav')
} else {
document.body.classList.remove('fixed_nav')
}
}
@cziem
cziem / stickyNav.js
Created November 12, 2018 10:22
write a function to control fixation
const stickyNav = () => {
if (window.scrollY >= navTop) {
document.body.classList.add('fixed_nav')
} else {
document.body.classList.remove('fixed_nav')
}
}
@cziem
cziem / fixed-nav.css
Created November 12, 2018 10:17
the magical fixation
/* FIXED NAV */
.fixed_nav li.logo {
max-width: 500px;
display: inline-flex;
transform: translateX(0)
}
body.fixed_nav nav {
position: fixed;
box-shadow: 0 5px 0 rgba(0, 0, 0, 0.1);
@cziem
cziem / footer.css
Created November 12, 2018 10:15
give some life to the footer