Skip to content

Instantly share code, notes, and snippets.

View Fabian295's full-sized avatar
🏠
Working from home

Fabian Kanhai Fabian295

🏠
Working from home
  • the Netherlands
  • 22:51 (UTC +02:00)
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Templates</title>
<meta name="viewport" content="width=device-width">
<style>
.temp{
background-color: cornflowerblue;
color: #fff;
@Fabian295
Fabian295 / index.html
Created March 21, 2024 11:55 — forked from prof3ssorSt3v3/index.html
Code from video about practical uses for Array.from() and all of it's parameters applied to Objects and NodeLists and copied Arrays
<!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>
<script src="main.js" type="module"></script>
</head>
<body>
@Fabian295
Fabian295 / products-data.json
Created February 18, 2023 12:36
Products List with properties for the cart demo in vanilla js
{
"products": [
{
"id": 1,
"title": "Apple",
"desc":"Fugit dolorum consequatur rem molestiae, possimus dignissimos!",
"img": "red-apple.jpg",
"price": 0.25
},
{

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@Fabian295
Fabian295 / spa.css
Created November 19, 2022 12:26
SPA, Single Page Application, markup file, index.html, I called the file "spa.html" just to be clear. Also see the CSS and JS files, respectively spa.css and spa.js
body {
background-color: #252525;
font-family: 'Quicksand', sans-serif;
color: #fff;
}
header, header nav ul {
display: flex;
align-items: center;
justify-content: space-between;
@Fabian295
Fabian295 / typed-arrays.js
Created September 4, 2022 12:14
Typed Arrays are building blocks for a buffer, which represent a generic, fixed-length raw binary data buffer., accessible through a DataView
/***********************************
Typed Arrays in JavaScript
Int8Array - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
-128 to 127
Uint8Array - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
0 - 255
Uint8ClampedArray - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray
0 - 255
Int16Array - like Int8Array but 16 bits in length
-32768 to 32767
<!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>Using Regular Expressions</title>
<style>
html {
@Fabian295
Fabian295 / minmax-clamp.css
Created December 12, 2021 20:56
css/ min(), max(), clamp() . Use math to calculate your css sizes, fonts, etc.
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-size: 20px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-weight: 300;
<?php
//Arrays in PHP
//keys can be integers or strings
// [] v5.4 and up
//$toppings = ['Ketchup', 'Mustard', 'Pickles', 'Onions'];
$toppings = array('Ketchup', 'Mustard', 'Pickles', 'Onions');
$toppings[] = 'Lettuce'; //$toppings[4]
echo $toppings[2];
@Fabian295
Fabian295 / canvas-pie-charts.html
Created September 26, 2021 08:50
HTML5 Canvas - Making Pie Chart Graphics with the math from sohcahtoa, sine, cosine, tanges.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Canvas Pie Charts</title>
<style>
canvas{
border: 2px solid #333;
margin: 2rem auto;