Skip to content

Instantly share code, notes, and snippets.

View GitSquared's full-sized avatar
👨‍🎤

Gabriel Saillard GitSquared

👨‍🎤
View GitHub Profile
@GitSquared
GitSquared / import.html
Last active January 22, 2021 14:35
Simple HTML Import with custom element that replaces itself with imported content
<script>
window.customElements.define('get-import', class extends HTMLElement {
constructor() {
super();
if (this.hasAttribute('url'))
window.fetch(this.attributes.url.value)
.then(res => res.text())
.then(txt => this.outerHTML = txt);
}
});
import { RefObject, useState, useEffect } from "react";
type DimensionsTuple = [number, number]; // width, height
export function useResponsiveDimensions(
ref: RefObject<HTMLDivElement>
): DimensionsTuple {
const [dimensions, setDimensions] = useState<DimensionsTuple>([500, 300]);
useEffect(() => {
@GitSquared
GitSquared / patch.diff
Created April 4, 2022 06:20
eDEX-UI v2.2.8-2022-04-pre
diff --git a/package-lock.json b/package-lock.json
index 5fb6a76..674c6a6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,4325 +1,14 @@
{
"name": "edex-ui",
"version": "2.2.8",
- "lockfileVersion": 2,
+ "lockfileVersion": 1,
@GitSquared
GitSquared / receiver-demo.html
Last active September 20, 2023 16:55
Use your browser to access a remote terminal.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Remote terminal</title>
<link rel="stylesheet" href="xterm.css" />
<script src="terminal.class.js"></script>