Skip to content

Instantly share code, notes, and snippets.

View jcmkk3's full-sized avatar

Kyle Mitchell jcmkk3

View GitHub Profile
@jcmkk3
jcmkk3 / alpha23332.md
Last active May 12, 2024 04:39
23332 Key Alpha Layouts

hands down neu23332

w c l d _   _ u o y '
r s n t p   k a e i h
_ f m g b   j x , . _

hands down neu23332-hindex

w c l d _   _ y o u '
@jcmkk3
jcmkk3 / average_in_many_languages.md
Last active October 6, 2023 17:22
Simple Average in Many Languages

Simple Average in Many Languages

This was an exercise to take a peek at some different languages using a simple algorithm.

Average is an interesting algorithm to compare languanges. It is simple, but has enough complexity to demonstrate some differences between the languages.

Average requires calculating two different summary statistics (sum and count), then combining those two (division) into a single number. An efficient solution would only traverse the collection of numbers once.

Each of these are written as a function that would be given a collection of numbers. Whatever a collection means in that particular language. Some languages have multiple solutions that might have different tradeoffs.

@suhr
suhr / nk.csv
Last active April 25, 2023 10:39
Syntax Name Description Example Output
+/x Sum Sum all value in x +/1 2 3 4 5 15
-':x Deltas Pairwise differences in x -':1 2 3 4 1 1 1 1
|+x Rotate matrix Rotate x counterclockwise |+3 3#!9 (2 5 8;1 4 7;0 3 6)
x@<x Sort Sort x {x@<x}@8 3 7 1 1 3 7 8
?x,y Set union Unique elements from x and y ?"abac","adob" "abcdo"
x^x^y Intersection Common elements from x and y {?x^x^y}["abac";"adob"] "aba"
x|-x Absolute value Absolute value of x {x|-x}@-1 1
*/y#x Power x in power of y (y>0) {*/y#x}[2;5] 32
y@(#y)!x+!#y Rotate left Rotate y by x elements to the left {y@(#y)!x+!#y}[3;"abcde"] "deabc"
@mmarshall540
mmarshall540 / simple-modal.el
Last active December 17, 2023 11:00
A simplistic modal editing system.
;; This is based on a Dvorak keyboard layout and isn't
;; very comprehensive. The purpose is just to demonstrate
;; that you can create your own modal editing system in Emacs
;; using only a little bit of code.
;;
;; After loading this file, you can use "M-\" to enter command
;; mode (aka "normal-state").
;;
;; To exit back to "insert-state", press "i".
@haji-ali
haji-ali / echo-line.el
Last active August 30, 2022 08:48
Echo messages in minibuffer
;;; echo-line.el --- Echo messages in minibuffer -*- lexical-binding:t -*-
;;
;; Author: Al Haji-Ali <[email protected]>
;; Version: 0.1.0
;; Package-Requires: ((emacs "26.1"))
;; Keywords: message, echo, gui
;;
;; This file is not part of GNU Emacs.
;;
;; This program is free software; you can redistribute it and/or modify
@chrispsn
chrispsn / k_tech_tree.md
Last active March 26, 2024 01:00
k tech tree

k tech tree

Thought experiment:

Which k primitives can be implemented as k-strings, reasonably efficiently, with a handful of 'native' built-ins?

Not verified to be in dependency order yet... may depend on the choice of 'fundamental' primitives. Need to do speed tests too.

k9 syntax (download via Shakti). Got a better way to write one? Feel free to comment, you'll be credited!

@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@RichardBronosky
RichardBronosky / README.MD
Last active October 10, 2024 11:11
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <[email protected]> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*