Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active December 17, 2025 23:35
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@gaearon
gaearon / modern_js.md
Last active December 2, 2025 08:14
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@gaearon
gaearon / index.html
Last active September 27, 2025 02:50
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Backgrounds</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="main.css" />
<!--
MDN background reference
https://developer.mozilla.org/en-US/docs/Web/CSS/background
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Web Workers</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="../video-pages/main.css">
</head>
<body>
<header>
self.addEventListener('message', (ev)=>{
//console.log('Web worker started with data: ', ev.data);
let data = ev.data.do;
switch(data){
// case 'Get Started':
// self.postMessage('Web Worker Started');
// break;
// case 'Other':
// self.postMessage('Other task...');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS box-sizing</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="main.css"/>
<style>
html{
box-sizing: border-box;
@modster
modster / nodejs-tcp-example.js
Created September 15, 2018 07:35 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Div vs. Span</title>
<style>
span{
color: hsla(0deg, 50%, 100%, 0.5);
background-color: cornflowerblue;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Grid &amp; grid-auto-flow</title>
<style>
*{
box-sizing: border-box;
}
.box{