Skip to content

Instantly share code, notes, and snippets.

View joshparkerj's full-sized avatar
🥰

Josh Parker joshparkerj

🥰
View GitHub Profile
@joshparkerj
joshparkerj / graphs.md
Created June 17, 2024 11:55
graphs from silly-internet-repo

Okay, here's what I've got for a very basic diagram, just showing what calls which (when rendered visually, it's quite the rat's nest hahahahaha):

text effect dependency graph

flowchart TD
 A --> K[General Element]
 A --> L[Element Effect Handler]
 B[Binary] --> H[General Text]
 H --> K
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Danfo&family=Jacquard+12&family=Poetsen+One&display=swap"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Danfo&family=Jacquard+12&family=Poetsen+One&display=swap"
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>S W A V E</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Danfo&family=Jacquard+12&family=Poetsen+One&display=swap"
<!DOCTYPE html>
<html>
<head>
<title>S W A V E</title>
<style>
body {
overflow: hidden;
margin: 0;
}
function calculateSpecificity(selector) {
// Remove :is(), :not(), and :has() pseudo-classes and retain their parameters
const cleanedSelector = selector.replace(/:(is|not|has)\(([^)]*)\)/g, ' $2 ');
const attributeRegExp = /\[[^\]]*\]/g;
const attributeCount = cleanedSelector.match(attributeRegExp)?.length || 0;
const noAttributes = cleanedSelector.replace(attributeRegExp, '');
const pseudoElementRegExp = /::[^.:#>~+\s]+/g;
const pseudoElementCount = noAttributes.match(pseudoElementRegExp)?.length || 0;
@joshparkerj
joshparkerj / pick-some-stock.py
Created July 19, 2023 13:37
pick some stock
from numpy import random
a = ["AAPL",
"MSFT",
"AMZN",
"NVDA",
"GOOGL",
"TSLA",
"GOOG",
"META",
// ==UserScript==
// @name Sketchify Page!
// @namespace http://tampermonkey.net/
// @version 0.1
// @description use a simple sketch effect on any page
// @author Josh Parker
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=wikipedia.org
// @grant none
// ==/UserScript==
<!DOCTYPE html>
<html>
<head>
<title>fans</title>
<style>
.fan,
.inner-ring,
.outer-led,
.inner-led {
border-radius: 100%;