Skip to content

Instantly share code, notes, and snippets.

View GitSquared's full-sized avatar
👨‍🎤

Gabriel Saillard GitSquared

👨‍🎤
View GitHub Profile
@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>
@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,
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 / 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);
}
});
@GitSquared
GitSquared / caesar-cypher.js
Created January 16, 2020 21:34
JS Caesar Cypher
const letters = 'abcdefghijklmnopqrstuvwxyz';
let circleBackAlphabet = new Proxy({ letters }, {
get: (obj, index) => {
let ltrs = obj.letters;
while(index > ltrs.length-1) {
index = index - ltrs.length;
}
return ltrs[index];
}
@GitSquared
GitSquared / pubkey.class.js
Last active November 20, 2019 22:03
Node.js ssh-rsa public key parser
/*
* PubKey class
* Reads, parses and provides a usable node-rsa key object
* from a ssh-rsa PEM-encoded public key file.
*/
class PubKey {
constructor(path) {
const Rsa = require('node-rsa');
const fs = require('fs');
@GitSquared
GitSquared / launch.sh
Created April 28, 2019 09:28
Bash script to make a Debian-based "eDEX system"
#!/bin/bash
#
# This script was designed for a blank Debian install
# Only dependencies are X.org (not automatically starting at boot),
# pulseaudio for sound support, ssh, plus any dependency required by
# AppImage - you can see them by trying to launch the AppImage manually
# before installing this auto-start script.
#
# Place "eDEX-UI.Linux.x86_64.AppImage" in the user folder
# $ chmod +x ~/launch.sh
{
"colors": {
"r": 170,
"g": 207,
"b": 209,
"black": "#000000",
"light_black": "#05080d",
"grey": "#262828"
},
"cssvars": {
@GitSquared
GitSquared / timecodes_edex_fr.md
Created February 3, 2019 12:03
List of all sound effects needed for eDEX-UI (copy of a mail I sent to a sound designer friend of mine, in French)

Liste des SFX pour eDEX-UI

  1. Boot log (utilisation des SFX "feedback output" - voir plus bas - donc rien à faire ici en principe)
  2. Jingle/Séquence titre (Black screen 400ms, Titre 300ms, Effet glitch 600ms, Titre 1200ms)
  3. Apparition terminal *(Étendu largeur 500ms, étendu hauteur 500ms)
  4. Apparition clavier (Étendu largeur de chaque rangée de touche, timing pour chaque rangée du haut vers le bas: 800ms, 600ms, 500ms, 800ms, 600ms - toutes les animations sont lancées en synchro)
  5. Message de bienvenue (Welcome, user! Lancé en même temps que l'apparition clavier - Apparition fondu 500ms, hold 100ms, disparition fondu 500ms) (ptetre utiliser un bip de feedback pour ça?)
  6. Apparition des panneaux latéraux (Apparition fondu 500ms enchainée de module en module)
console.log("START");
let i = 0;
let left = ["left_one", "left_two", "left_three", "left_four"];
let right = ["right_one", "right_two"];
let x = setInterval(() => {
if (!left[i] && !right[i]) {
console.log("DONE!");
clearInterval(x);
} else {
console.log(`RUN ${i}: ${(i+1)*500}MS`);