Skip to content

Instantly share code, notes, and snippets.

View asuh's full-sized avatar

Micah asuh

View GitHub Profile
/*
* Fluid Typography
* https://smashingmagazine.com/2022/10/fluid-typography-clamp-sass-functions/
*/
@use 'sass:math';
$default-min-bp: 320px;
$default-max-bp: 960px;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Code Sandbox</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
@asuh
asuh / gist:7d3dc277ecdc7d654d8c681bc1b281d3
Created September 14, 2023 23:40
Defensive Fetch Response
async function getGithubProfile(username) {
let response;
try {
response = await fetch(`https://api.github.com/users/${username}`);
} catch (error) {
throw new Error(`Network error: ${error.message}`);
}
if (!response.ok) {
const message = `HTTP error! status: ${response.status}`;