Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created October 1, 2022 19:56
Code from video about generating UUIDs with JavaScript
<!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>
<style>
html {
font-size: large;
@RenaudRohlinger
RenaudRohlinger / usePostProcess.jsx
Last active December 31, 2022 21:40
usePostProcess.jsx
import { useFrame, useThree } from '@react-three/fiber'
import { useEffect, useMemo } from 'react'
import * as THREE from 'three'
function getFullscreenTriangle() {
const geometry = new THREE.BufferGeometry()
const vertices = new Float32Array([-1, -1, 3, -1, -1, 3])
const uvs = new Float32Array([0, 0, 2, 0, 0, 2])
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 2))
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created September 5, 2022 14:07
Code from video about : vs ::
<!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>: vs :: in CSS</title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
@benpate
benpate / template-fragments.go
Last active October 8, 2024 12:44
Demonstration of Template Fragments using the standard Go template library
package main
import (
"html/template"
"net/http"
"strconv"
)
/***********************
This is a simple demonstration of how to use the built-in template package in Go to implement

Rust Cheat Sheet

Variables & Mutability

Variables are immutable by default. This makes Rust safer and makes concurrency easier.
Immutable means once a value is bound to that variable, it cannot be changed.
For example:

fn main() {
 let x = 5;
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created August 3, 2022 19:11
Code from video on color-scheme and prefers-color-scheme
<!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>color-scheme and prefers-color-scheme</title>
<meta name="color-scheme" content="light dark" />
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created June 28, 2022 14:35
Code from Video on building Custom Response Objects
<!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" />
<link rel="stylesheet" href="style.css" />
<script src="response.js" async defer></script>
<title>Custom Response</title>
</head>
@modster
modster / webgl-screenshot.glsl
Last active May 12, 2022 04:00
webgl-tips-screenshot-good
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
// WebGL2 Tips - Good Screenshot
// from https://webgl2fundamentals.org/webgl/webgl-tips-screenshot-good.html
"use strict";
@modster
modster / server.js
Last active January 19, 2022 04:54
Simple Express Server
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.sendFile(__dirname + '/index.html');
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
@modster
modster / app.js
Created November 16, 2021 03:19 — forked from ArunMichaelDsouza/app.js
Woodlot middlewareLogger config
var express = require('express');
var app = express();
var woodlot = require('woodlot').middlewareLogger;
app.use(woodlot({
streams: ['./logs/app.log'],
stdout: false,
routes: {
whitelist: ['/api', '/dashboard'],
strictChecking: false