Skip to content

Instantly share code, notes, and snippets.

View webdesignberlin's full-sized avatar
:octocat:
...

Michael Raguse webdesignberlin

:octocat:
...
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Screen recorder</title>
</head>
<body>
<button id="recording-toggle">Start recording</button>
<script defer>
@Adamwaheed
Adamwaheed / useAPI.ts
Created June 9, 2023 19:09
Dependancy and useAPI
import { build } from "nuxt";
import { Data } from "~/types/generated";
export const useAPI = (
url: string,
items: any,
meta: any,
item: any,
status: any,
errors: {}
@jonathantneal
jonathantneal / ui-monospace.css
Created July 31, 2022 23:16
CSS ui-monospace polyfill (448 bytes minified, 182 gzipped)
/* These rules are ignored when ui-monospace is supported. */
@font-face { font-family: ui-monospace; src:
/* MacOS (El Capitan +) */
local(Menlo-Regular),
/* Windows (11 +) */
local(CascadiaCode-Regular),
/* Windows (Vista +) */
local(Consolas),
/* Android */
local(RobotoMono-Regular),
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@gmetais
gmetais / gist:9dc573c607447bb57189920a1635173a
Last active June 13, 2022 22:58
A very simple an rough script that lists fonts that are loaded on a page and enumerates all elements that actually use each one. Helps discover if some fonts are loaded but barely used, so that you can skip them.
/* Simply copy and paste in the browser's console */
function weightToNumber(str) {
if (str === 'normal') {
return 400;
}
if (str === 'bold') {
return 700;
}
return parseInt(str, 10);
@jonathantneal
jonathantneal / CSSStyleObserver.js
Created April 7, 2022 04:34
CSS Style Observer (695 bytes minified, 397 bytes gzipped)
class CSSStyleRecord {
constructor(
/** @type {{ target: Element, propertyName: string, oldValue: string, newValue: string }} */
init
) {
Object.assign(this, init)
}
}
class CSSStyleObserver {
@DavidWells
DavidWells / github-proxy-client.js
Last active March 15, 2024 08:28
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@WebReflection
WebReflection / wordle.md
Last active January 21, 2022 11:31
Create wordle report

Apparently there's no share button after wordling in my browsers, so I created this copy/paste JS to put in console, which will produce an output like:

Wordle 212 4/6

⬛⬛🟨⬛🟨
🟨🟨🟨🟨⬛
🟩🟨⬛🟨🟨
🟩🟩🟩🟩🟩
interface Without {
without(withoutWord: string): boolean;
}
// 1. Easiest / the way I'd do it
function youCantSpell(word: string): Without {
return {
without(withoutWord: string) {
return word.includes(withoutWord);
}