Skip to content

Instantly share code, notes, and snippets.

calculateItems() {
let currentPage = 3; //needs to be get dynamically
let itemsTotal = 25;
const maxItemsPerPage = 12;
const lastPage = Math.trunc(itemsTotal / maxItemsPerPage) + 1;
let shownFrom, shownTo;
img {
background-color: #ccc;
background-size: 30%;
text-align: center;
line-height: 7;
color: #000;
}
img:after {
content: "";
class DoubleDndedArray {
constructor(arr) {
this.arr = arr;
}
firstToEnd() {
const el = this.arr.shift();
this.arr.push(el);
}
class Queue {
constructor() {
// Record the length of the queue , size
this.count = 0;
// Record the first element of the queue
/********** fonts **********/
@font-face {
font-family: 'Inter';
src:
url(':f:inter-v8-latin-regular.woff2') format('woff2'),
url(':f:inter-v8-latin-regular.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'ejs');
app.listen(3000, () => {
console.log('app on port 3000');
GIT shortcuts
git add app && git commit -m "Initial dist subtree commit"
Add branch to host on GH pages
git subtree push --prefix app origin gh-page
***
@mixin font($font_name, $file_name, $weight, $style) {
@font-face {
font-family: $font_name;
font-weight: #{$weight};
font-style: #{$style};
font-display: swap;
src: url('../fonts/#{$file_name}.woff2') format('woff2');
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
button {
border: none;
margin: 0;
padding: 0;
width: auto;
background: transparent;
color: inherit;
font: inherit;
line-height: normal;
text-align: inherit;