Skip to content

Instantly share code, notes, and snippets.

View razetime's full-sized avatar
⤵️
real

Raghu R razetime

⤵️
real
View GitHub Profile
@razetime
razetime / tiotext.js
Created December 21, 2020 02:07
A userscript that prevents tio from text wrapping, and provides a scrollbar instead.
// ==UserScript==
// @name tio text
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('DOMContentLoaded', (event) => {
var textA = document.getElementsByTagName("textarea");
for(var i=0;i<textA.length;i++){
@razetime
razetime / chatexec.user.js
Last active December 30, 2020 05:35
Executes apl code inside a chat box textarea(first line only). Can be changed to target any website/textarea.
// ==UserScript==
// @name Chat box exec
// @version 1.0
// @description Executes apl code inside a chat box textarea!
// @namespace http://tampermonkey.net/
// @grant GM_xmlhttpRequest
// @grant GM_listValues
// @match https://chat.stackexchange.com/*
// @run-at document-start
// ==/UserScript==
@razetime
razetime / APLchat.js
Last active January 1, 2021 09:30
Userscript for executing apl code in chat
// ==UserScript==
// @name APL chat
// @version 2
// @grant GM_xmlhttpRequest
// @grant GM_listValues
// @match https://chat.stackexchange.com/*
// @run-at document-start
// @require https://gitlab.com/n9n/apl/-/raw/master/apl.js
// ==/UserScript==
@razetime
razetime / index.html
Last active January 9, 2021 09:57
vyxal web new
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/style.css') }}">
<link rel="stylesheet" href="style.css">
<script>

K tutorial

Welcome to K. K is an array-based programming language. Although this term may sound new to many programmers, K comes from a lineage of programming languages which date back to the 1960s.

It is the 1960s. Enter APL. APL originally started out as a general math notation, made to standardise the way mathematical expressions can be looked at. With the creation of APL's revolutionary math notation came the realization that it was very effective at describing algorithms, making it very effective with consistently communicating algorithmic, math-oriented thought. This original award winning idea eventually became what is known today as the APL programming language.

Array languages to this day are still a rather niche area, since they are very unlike what people are taught as beginner programmers. Hence, I'd like to request all viewers to maintain an open mind and have fun.

K is an APL-style array language which aims to eliminate many of APL's problems in programming. At a glance, the most noticeabl

@razetime
razetime / mfck.js
Created December 26, 2020 16:24
Moanfuck implementation in js
// moanfuck implementation in JavaScript
// Use as: interpret(<mf code>)
// or: interpret(convert(<bf code>)) if you want to try using bf code.
// logs to the console.
// borrowed from https://github.com/trekhleb/javascript-algorithms/blob/master/src/algorithms/string/levenshtein-distance/levenshteinDistance.js
function levenshteinDistance(a, b) {
// Create empty edit distance matrix for all possible modifications of
// substrings of a to substrings of b.
const distanceMatrix = Array(b.length + 1).fill(null).map(() => Array(a.length + 1).fill(null));
@razetime
razetime / translate.jl
Created April 16, 2022 10:44
translating a circle
# Based on Josh Pullen's translation animation:
# https://twitter.com/PullJosh/status/1453393772314718215
using Javis
using Animations
function ground(args...)
background("white")
sethue("black")
end
⍝ Simple BST
jt←↑(2 6) (3 5) (4 0) (0 0) (0 0) (7 8) (0 0) (0 0) ⍝ child nodes
jd← 27 14 10 3 19 35 31 42 ⍝ data
FindJE ← {
(t d)←⍺
s←⍵
1∘{x←⍺⊃d ⋄ n←(1+⍵>x)⊃⍺⌷t ⋄ (⍵=x)∨0=n:⍺ ⋄ n∇⍵}s
}
InsertJE ← {
(t d)←⍺
@razetime
razetime / LeMane_accepted_proposals.md
Created October 17, 2022 15:27
Let's make an esolang, accepted proposals for a potential impl

: @Deleted User

calling _() might delete the next line of code

[ 11:51 PM ] nailuj :

@razetime
razetime / aplspec.md
Last active October 21, 2022 06:47
APL spec

The language, all names, characters, and incidents portrayed in this production are fictitious. No identification with actual languages (living or deceased), places, buildings, and products is intended or should be inferred.

The language is called APL (asinine programming language), and it will be on the esolangs wiki under APL (esolang), probably mentioned under APL (disambiguation).

Functions are defined using ∇name (⍵,⍺) <stuff here> .. the (⍵,⍺) portion will always remain the same and cannot be changed. Only two arguments can be given to a function. All assignments are by reference.

Primitives