Skip to content

Instantly share code, notes, and snippets.

View technige's full-sized avatar
🇪🇺

Nigel Small technige

🇪🇺
View GitHub Profile
@technige
technige / parse-uri.js
Last active March 23, 2021 14:28
Basic URI parser in JS
// JS version of Python partition function
function partition(s, delimiter) {
const i = s.indexOf(delimiter);
if (i >= 0) return [s.substring(0, i), s[i], s.substring(i + 1)];
else return [s, "", ""];
}
// JS version of Python rpartition function
function rpartition(s, delimiter) {
const i = s.lastIndexOf(delimiter);
@technige
technige / elk-docker-howto.md
Last active November 18, 2021 17:08
How to run Elasticsearch and Kibana in local Docker containers

How to run Elasticsearch and Kibana in local Docker containers

This document contains step-by-step notes for how to run Elasticsearch and Kibana in local Docker containers.

This assumes three terminal windows are available: A (control), B (Elasticsearch) and C (Kibana). Note also that the stack version included here may be varied, although it should remain identical across both components.

1. Create a Docker network

In terminal A, run:

from argparse import ArgumentParser
from io import BytesIO
from PIL.Image import open as open_image
def image_to_ansi(data, scale=1):
# TODO: optimise this algorithm - it's pretty brute-force right now
image = open_image(BytesIO(data))
width, height = image.size
@technige
technige / alt
Created July 12, 2023 12:27
Alt switcher for bash
#!/usr/bin/env bash
MENU=$1
OPTION=$2
MENU_PATH=${HOME}/.alt/${MENU}
cd ${MENU_PATH}
if [ ! -z "$OPTION" ]
then
@technige
technige / snake.html
Created June 19, 2026 08:02
JS Snake game (oneshot from Ministral-3 14B Reasoning on local llama.cpp)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snake Game</title>
<style>
body {
display: flex;
justify-content: center;