Skip to content

Instantly share code, notes, and snippets.

View Underwaterr's full-sized avatar
🐝
Bzz bzz

Tyler Lane Underwaterr

🐝
Bzz bzz
View GitHub Profile
@Underwaterr
Underwaterr / index.html
Created July 23, 2022 14:23
Simple HTML Starter
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello, world!</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Welcome 2 My Homepage</h1>
<p>Thank u for visiting <code>https://www.example.com/</code>.</p>
@Underwaterr
Underwaterr / feels.html
Last active March 19, 2019 22:09
Blog-esque
<h2>Headline</h2>
<p>This is how I'm feeling:</p>
<p>I am feeling okay!</p>
@Underwaterr
Underwaterr / run-tests.js
Created October 29, 2018 15:29
Get multiple asynchronous JS modules and execute them
let requireGlob = require('require-glob')
let tests = await requireGlob(['api/**/test.js'], {
// Custom reducer returns flat array of functions
reducer: (options, moduleExports, module)=> {
// 'moduleExports' starts as an object, convert to array
if(!Array.isArray(moduleExports)) moduleExports = []
moduleExports.push(module.exports)
return moduleExports
}
@Underwaterr
Underwaterr / fibonacci.js
Last active September 22, 2018 17:05
Fibonacci Calculator
// What a classic!
function fibonacci(n) {
if(n == 1) return 1
else if (n == 2) return 1
else return (fibonacci(n-1) + fibonacci(n-2))
}
// Uses Node's "readline" module for input
// https://nodejs.org/api/readline.html
const readline = require('readline').createInterface({
@Underwaterr
Underwaterr / parseDate.js
Created January 13, 2017 17:43
Converts from C# DateTime object to JavaScript Date object
// Converts from C# DateTime object to JavaScript Date object
function parseDate(date) {
return new Date(parseInt(/-?\d+/.exec(date)[0]))
}
@Underwaterr
Underwaterr / Echelon Form
Last active September 22, 2018 17:01
Linear Algebra
public void Echelon_Form()
{
// Go through the first column, looking for something that is not a zero,
// Swap it with the first row, & make it a 1.
Fraction zero = new Fraction(0);
for (int i=0; i&lt;columns; i++) // Going up to down
{
// Divide each element along the column by pivot
Fraction divisor = new Fraction(A[i][i]);