Skip to content

Instantly share code, notes, and snippets.

View vickonrails's full-sized avatar
🖥️
writing code

Victor Ofoegbu vickonrails

🖥️
writing code
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Form page</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js'></script>
<style>
*{
margin:0;
padding:0;
//server.js
const express = require('express'),
https = require('https'),
http = require('http'),
fs = require('fs'),
app = express();
//credentials obtained from a Certificate Authority
var options = {
const express = require('express'),
body_parser = require('body-parser'),
hbs = require('express-handlebars').create({defaultLayout: 'main',extname:'hbs'});
session = require('express-session'),
csurf = require('csurf'),
app = express();
//setting the app port
app.set('port', process.env.PORT || 3000);
//requiring express and handlebars
//.create() method configures handlebars. We’ll explain that in a while
const express = require('express'),
  hbs = require('express-handlebars').create({defaultLayout: 'main', extname: 'hbs'});
  app = express();
//set the app engine to handlebars
app.engine('hbs', hbs.engine);
app.set('view engine','hbs');
<!-- home.hbs -->
<p> Hello I’m just a home file </p>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<!-- the {{home}} got replaced-->
<title> HOME </title>
<link rel='stylesheet' href='css/style.css'/>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title> {{title}} </title>
<link rel='stylesheet' href='css/style.css'/>
</head>
<body>
Hello world
@vickonrails
vickonrails / offline-indicator.html
Created August 20, 2019 13:46
An example of an app that notifies the user of offline and online states
<!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>Offline/Online Demo</title>
<style>
import React, { useState } from "react";
import styled from "styled-components";
import "./App.css";
// Styled components definitions for all components
const Header = styled.header``;
const Nav = styled.nav``;
const MainContent = styled.main``;
const Container = styled.div``;