Skip to content

Instantly share code, notes, and snippets.

View thaliaarchi's full-sized avatar

Thalia Archibald thaliaarchi

View GitHub Profile
@thaliaarchi
thaliaarchi / README.md
Last active June 13, 2022 18:30
Demo of LSP inlay hints in Whitespace

Inlay Hints for Whitespace

The syntax of the Whitespace programming language is invisible—it uses only space, tab, and line feed—so editing a program manually is tedious and most people will instead develop using a “Whitespace assembly” syntax with readable opcodes. I am working on a to-be language server for Whitespace that will use inlay hints to display the opcodes in the invisible syntax. The LSP only allows Type and Parameter values for InlayHintKind, which is exclusive of this use case (vscode#151920). I propose that this enum be extended to include a variant for this case.

@thaliaarchi
thaliaarchi / node-install.sh
Created June 21, 2018 06:48
Install node and npm on a Raspberry Pi or other ARM-based systems
#!/usr/bin/env bash
# https://raspberrypi.stackexchange.com/questions/4194/getting-npm-installed-on-raspberry-pi-wheezy-image
# Deletes previous installation of node
# Architecture can be found with `uname -m`
version=$1
if [ $# -eq 0 ]; then
read -p "Node version to install (e.g. v8.11.3): " version
@thaliaarchi
thaliaarchi / pre-commit
Last active June 7, 2018 20:03 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all javascript console.log statements before commit.
#!/bin/sh
# Prevent console.log from appearing in commits
# https://gist.github.com/guilherme/9604324
# Redirect output to stderr
exec 1>&2
# Enable user input
exec < /dev/tty
consoleregexp='^\+.*console\.log'
@thaliaarchi
thaliaarchi / install_gtest_ubuntu.md
Last active May 31, 2018 04:03 — forked from Cartexius/install_gtest_ubuntu.md
Install gtest in Ubuntu
@thaliaarchi
thaliaarchi / color-libraries.md
Last active September 23, 2017 05:47
Color libraries and color spaces
@thaliaarchi
thaliaarchi / css4-colors.js
Last active May 10, 2024 03:07
W3 Specs for CSS4 colors using RegExp
// https://drafts.csswg.org/css-values-3/#integers
var INTEGER = "[-\\+]?\\d+";
// https://drafts.csswg.org/css-values-3/#numbers
var NUMBER = "[-\\+]?(?:\\d*\\.)?\\d+";
// https://drafts.csswg.org/css-values-3/#percentages
var PERCENTAGE = NUMBER + "%";
// https://drafts.csswg.org/css-values-3/#angle-value
var ANGLE = NUMBER + "(:?deg)|(:?grad)|(:?rad)|(:?turn)";
function cssFunction(name, values, optional) {
@thaliaarchi
thaliaarchi / async-scripts.ts
Created October 10, 2016 02:29
Load multiple scripts asynchronously in javascript
loadScripts([
'https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.4.1/tinycolor.min.js',
'https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'
], () => {
console.log('Scripts loaded');
let color = tinycolor('hsl(207, 95%, 44%)');
console.log(color);
$('body').css('background-color', color.toHexString());
});
@thaliaarchi
thaliaarchi / taskkiller.bat
Created October 6, 2016 20:57
A task killer for those times you can't use Task Manager
@echo off
:start
cls
tasklist
echo ==========
set /p process=Process:
taskkill /f /im %process%
pause
goto start