Skip to content

Instantly share code, notes, and snippets.

Gaby GitSquared

View GitHub Profile
View caesar-cypher.js
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 Nov 20, 2019
Node.js ssh-rsa public key parser
View pubkey.class.js
/*
* 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 Apr 28, 2019
Bash script to make a Debian-based "eDEX system"
View launch.sh
#!/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
View tron-notype-responsive.json
{
"colors": {
"r": 170,
"g": 207,
"b": 209,
"black": "#000000",
"light_black": "#05080d",
"grey": "#262828"
},
"cssvars": {
@GitSquared
GitSquared / timecodes_edex_fr.md
Created Feb 3, 2019
List of all sound effects needed for eDEX-UI (copy of a mail I sent to a sound designer friend of mine, in French)
View timecodes_edex_fr.md

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)
View keybase.md

Keybase proof

I hereby claim:

  • I am gitsquared on github.
  • I am squared_0 (https://keybase.io/squared_0) on keybase.
  • I have a public key ASCO3nTnobplOnnL7HwlMqshb4ouEgUnI4-Ai0E7LN0wwQo

To claim this, I am signing this object:

View displayerTest.js
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`);
@GitSquared
GitSquared / configFileReader.js
Last active Mar 1, 2018
Node.js module to load a configuration file.
View configFileReader.js
/*
Configuration file reader module. Takes an absolute file path and the boolean watch as arguments.
* filePath is expected to be the path to a JSON file (with the .json extension).
* watch is optional and defaults to false. If set to true, the config file will be watched by fs and any changes made to it will be automatically reflected on the module instance.
Returns an object:
* filePath: The file currently in use.
* watching: Boolean, indicate if the config file is being monitored for changes.
* config: Object containg the parsed data of the config file.
* parseFile(path, watch): Parse a config file. If you specify a new file, set watch to true to start watching it for changes, too. As always, watch defaults to false.
@GitSquared
GitSquared / colorify.js
Created Sep 30, 2017
Colorify a whole CSS theme using color.js
View colorify.js
const Color = require('color');
const colorifyTarget = Color("#bee6c1");
let original = require('fs').readFileSync("original.css", {encoding: "utf-8"});
console.log(original);
let colorified = original.replace(/(#{1}[0-g]{6})+/ig, (match) => {
console.log(match);
return Color(match).grayscale().mix(colorifyTarget, 0.3).hex(); // Edit colorify options here
});
console.log(colorified);
@GitSquared
GitSquared / receiver-demo.html
Last active Jul 7, 2020
Use your browser to access a remote terminal.
View receiver-demo.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Remote terminal</title>
<link rel="stylesheet" href="xterm.css" />
<script src="terminal.class.js"></script>
You can’t perform that action at this time.