Skip to content

Commit

Permalink
general cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Feb 9, 2024
1 parent 15656a6 commit 48a54e9
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 76 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
font-size: 1.2em;
max-width: 800px;
}
a, a:hover, a:visited, a:active {

a,
a:hover,
a:visited,
a:active {
color: #0362fc;
}

a:hover {
font-weight: bold;
}
Expand Down Expand Up @@ -128,8 +133,8 @@ <h3>Legal and Financial Details</h3>

<p>
<b>Why?</b> After hearing about the
<a href="https://intuitiveexplanations.com/tech/replit/"
target="_blank">legal threats experienced by Radon Rosborough from Replit</a>
<a href="https://intuitiveexplanations.com/tech/replit/" target="_blank">legal threats experienced by Radon
Rosborough from Replit</a>
I decided to start an LLC to protect myself from similar threats. (I also thought it would be
fun to own a company.) I am slowly migrating my open source work and other projects to Nevarro
LLC, and I may start additional businesses under this LLC eventually as well.
Expand All @@ -149,7 +154,7 @@ <h3>Legal and Financial Details</h3>
<hr />

<p>
Here's a picture of Nevarro City from The Mandalorian
Here's a picture of Nevarro City from <i>The Mandalorian</i>.
</p>
<img src="nevarro-city.webp" width="800" />
<p>
Expand All @@ -158,4 +163,3 @@ <h3>Legal and Financial Details</h3>
</body>

</html>

147 changes: 77 additions & 70 deletions matrix-link-to-useful-text.html
Original file line number Diff line number Diff line change
@@ -1,81 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<title>Matrix Link to Useful Text</title>
<style>
input, textarea, button {
width: 700px;
font-size: 1.5em;
}
textarea {
height: 150px;
}
#error-text {
color: red;
}
</style>
<script defer data-domain="nevarro.space" src="https://plausible.io/js/script.js"></script>
</head>
<body>
<p>
<input id="permalink-input" type="text" placeholder="enter your matrix.to permalink here"/>
</p>
<p id="error-text">
</p>
<p>
<textarea id="useful-text" onclick="this.select()" readonly></textarea>
</p>
<p>
<button id="copy-button" disabled>Copy</button>
</p>
<p>
<a href="https://github.com/sumnerevans/nevarro.space">Source Code</a>
</p>

<script>
const permalinkInput = document.getElementById("permalink-input");
const errorText = document.getElementById("error-text");
const usefulText = document.getElementById("useful-text");
const copyButton = document.getElementById("copy-button");
<head>
<title>Matrix Link to Useful Text</title>
<style>
input,
textarea,
button {
width: 700px;
font-size: 1.5em;
}

const getInfo = (permalink) => {
const match = permalink.match(/^https?:\/\/matrix.to\/#\/(!.*)\/(\$.*?)(?:\?.*)?$/);
if (!match) return null;
return {
roomID: match[1],
eventID: match[2],
};
};
textarea {
height: 150px;
}

const copy = () => {
usefulText.select();
document.execCommand("copy");
};
#error-text {
color: red;
}
</style>
<script defer data-domain="nevarro.space" src="https://plausible.io/js/script.js"></script>
</head>

const updateInfo = () => {
const info = getInfo(permalinkInput.value);
if (info) {
errorText.innerHTML = "";
usefulText.innerHTML = `Room ID: ${info.roomID}\nEvent ID: ${info.eventID}`;
copyButton.disabled = false;
} else {
errorText.innerHTML = "Invalid matrix.to link";
copyButton.disabled = true;
}
return info != null;
};
<body>
<p>
<input id="permalink-input" type="text" placeholder="enter your matrix.to permalink here" />
</p>
<p id="error-text">
</p>
<p>
<textarea id="useful-text" onclick="this.select()" readonly></textarea>
</p>
<p>
<button id="copy-button" disabled>Copy</button>
</p>
<p>
<a href="https://github.com/sumnerevans/nevarro.space">Source Code</a>
</p>

permalinkInput.addEventListener("input", updateInfo);
<script>
const permalinkInput = document.getElementById("permalink-input");
const errorText = document.getElementById("error-text");
const usefulText = document.getElementById("useful-text");
const copyButton = document.getElementById("copy-button");

permalinkInput.addEventListener("keyup", (e) => {
if (e.key === "Enter" || e.keyCode === 13) {
copy();
}
});
const getInfo = (permalink) => {
const match = permalink.match(/^https?:\/\/matrix.to\/#\/(!.*)\/(\$.*?)(?:\?.*)?$/);
if (!match) return null;
return {
roomID: match[1],
eventID: match[2],
};
};

copyButton.addEventListener("click", copy);
const copy = () => {
usefulText.select();
document.execCommand("copy");
};

const updateInfo = () => {
const info = getInfo(permalinkInput.value);
if (info) {
errorText.innerHTML = "";
usefulText.innerHTML = `Room ID: ${info.roomID}\nEvent ID: ${info.eventID}`;
copyButton.disabled = false;
} else {
errorText.innerHTML = "Invalid matrix.to link";
copyButton.disabled = true;
}
return info != null;
};

permalinkInput.addEventListener("input", updateInfo);

permalinkInput.addEventListener("keyup", (e) => {
if (e.key === "Enter" || e.keyCode === 13) {
copy();
}
});

copyButton.addEventListener("click", copy);

permalinkInput.focus();
</script>
</body>

permalinkInput.focus();
</script>
</body>
</html>

0 comments on commit 48a54e9

Please sign in to comment.