Skip to content

Instantly share code, notes, and snippets.

@dyarfi
dyarfi / sass-placeholder-beforeafter.html
Last active May 4, 2020 17:28
HTML Setup SCSS placeholder on ::before and ::after
<div class="shape">
<div class="shape-body">
<h1 class="headline">Headline Website</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<h2 class="title">Headline Website</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
<div class="shape">
<div class="shape-body">
@dyarfi
dyarfi / sass-placeholder-beforeafter.scss
Last active May 4, 2020 17:27
SCSS %placeholder on ::before and ::after property
// Before and after with the same properties
%beforeafter {
content: '';
position: absolute;
display: block;
z-index: 1030;
left: 0;
right: 0;
}
// Shape
@dyarfi
dyarfi / sass-placeholder-beforeafter.css
Last active May 4, 2020 17:27
CSS Result on SCSS %placeholder with ::before and ::after property
.shape-body {
-webkit-transition: box-shadow .5s ease;
transition: box-shadow .5s ease;
}
.shape-body:before, .shape-body:after {
content: '';
position: absolute;
display: block;
z-index: 1030;
@dyarfi
dyarfi / default
Created March 29, 2020 17:42 — forked from miguelmota/default
Nginx + Node.js server configuration. Blog post: http://www.miguelmota.com/blog/nodejs-and-ngnix-on-ubuntu/
# The upstream module is the link between Node.js and Nginx.
# Upstream is used for proxying requests to other servers.
# All requests for / get distributed between any of the servers listed.
upstream helloworld {
# Set up multiple Node.js webservers for load balancing.
# max_fails refers to number of failed attempts
# before server is considered inactive.
# weight priorities traffic to server. Ex. weight=2 will recieve
# twice as much traffic as server with weight=1
server <your server ip>:3000 max_fails=0 fail_timeout=10s weight=1;
@dyarfi
dyarfi / package.json
Created March 30, 2020 03:59
NextJS with Reactstrap
{
"name": "nextjs-reactstrap",
"description": "NextJS with Reactstrap Dashboard",
"keywords": [
"NextJS",
"ReactJS",
"Reactstrap"
],
"homepage": "https://github.com/dyarfi/nextjs-reactstrap",
"version": "0.1.0",
@dyarfi
dyarfi / postcss.config.js
Created March 30, 2020 04:06
NextJS autoprefixer and cssnano (PostCSS) config
module.exports = {
plugins: [
// PostCSS Config
require("cssnano")({
preset: [
"default",
{
discardComments: {
removeAll: true
}
<!DOCTYPE html>
<html ⚡>
<head>
<meta charset="utf-8" />
<link rel="canonical" href="Regular-non-AMP-page.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<title>Test saja</title>
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700,800&display=swap"
rel="stylesheet"
<html>
<head>
<title>Test saja</title>
<meta charset="utf-8" />
<link rel="amphtml" href="https://youroriginalwebpagelink/amp.html">
<meta name="viewport" content="width=device-width,minimum-scale=1" />
</head>
<body>
<div class="header">
<h2>Header</h2>
@dyarfi
dyarfi / package.json
Last active September 5, 2020 16:58
NPM packages for Sequelize v5.21 and Next.js v9.4 App
{
"name": "nextjs-sequelize",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
@dyarfi
dyarfi / config.js
Last active June 19, 2020 07:21
Sequelize config.js on with env variables
"use strict";
module.exports = {
development: {
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME,
host: process.env.DB_HOST,
dialect: "mysql",
},
test: {