Skip to content

Instantly share code, notes, and snippets.

View mlliarm's full-sized avatar

Michail Liarmako. mlliarm

  • 03:40 (UTC +02:00)
View GitHub Profile
@mlliarm
mlliarm / rss-twitter-hashtags.md
Last active March 27, 2024 02:55
How to use RSS to get updates from Twitter hashtags
@mlliarm
mlliarm / pealog.md
Last active November 26, 2022 10:35
Peano Axioms and Prolog

Pealog

What

Playing around with the Peano Axioms and Prolog.

I'd used one of the implementations of the multiplication and addition operations as defined in the Peano system, found in this StackOverflow question or this one. For some reason I haven't kept the source code, since it must have been like 4 LOC.

This gist is simply to store the results, but feel free to explore the solutions provided in the previous links to do your own experiments.

Why

@mlliarm
mlliarm / gists.md
Last active November 8, 2022 02:50
Gists
@mlliarm
mlliarm / square_free_numbers.ijs
Last active September 27, 2022 03:55
Square free numbers
NB. This problem was read in the blogpost (https://www.glc.us.es/~jalonso/exercitium/numeros-libres-de-cuadrados/) of @Jose_A_Alonso.
NB. Problem statement: given a positive integer N, it's called square-free if no square number (eg 2^2, 11^11) can be created from its prime divisors.
NB. Created using the J903 online playground (https://jsoftware.github.io/j-playground/bin/html2/).
NB. Let's get the matrix of the prime divisors of an array of integers
q: @> 10 30 40 1000 11 121
NB. 2 5 0 0 0 0
NB. 2 3 5 0 0 0
NB. 2 2 2 5 0 0
NB. 2 2 2 5 5 5
@mlliarm
mlliarm / multi_keyboard_rasp64_debian11.md
Created April 18, 2022 10:17
Multiple keyboard layouts on RaspberryOS 64 bit, Debian Bullseye

Multiple keyboard layouts on RaspberryOS 64 bit, Debian Bullseye

Issue

The issue is that if one follows the usual steps, the keyboard layout handler doesn't change the layouts. It's a very well known issue.

Solution

From the above link, and most specifically this post, the solution is as follows:

@mlliarm
mlliarm / obf_gol.py
Created April 15, 2022 18:02
Obfuscated python for the Game of Life
# Credit to `oskar31415` from the r/APLjk discord server for sharing the code and his friend for writing it.
'''
Original code:
(lambda N,P:(lambda f,i:P.show(__import__('matplotlib.animation',fromlist=['FuncAnimation']).FuncAnimation(f,lambda i:[i.set_array((lambda g:(lambda n:N.logical_or(n==3,N.logical_and(g,n==2)))((N.sum([N.roll(N.roll(g,y,1),x,0)for x in(-1,0,1)for y in(-1,0,1)if x|y],0))))(i.get_array())),[i]][1],interval=0,blit=1)))(P.figure(),P.imshow(N.random.rand(200,400)<.2,)))(__import__("numpy"),__import__("matplotlib.pyplot")) 
'''
# Expanded by mlliarm@
import pdb
try:
@mlliarm
mlliarm / linux-email.md
Created March 3, 2022 08:18
Nice email clients for GNU/Linux
@mlliarm
mlliarm / youtube-cli.md
Last active March 2, 2022 12:12
Youtube from the Linux CLI

Youtube from the Linux CLI

I really love listening to music when programming, on my old Linux laptop.

So, to save resources I looked for a CLI Youtube app. And there is an amazing one.

Enter yewtube

  • Yewtube is a fork of mps-youtube. Find yewtube here. Follow the instructions in the README.md file to install it.
  • Suggestion: install it within a virtual environment (virtualenv).
@mlliarm
mlliarm / oldtimer_APL_code.md
Last active February 25, 2022 23:01
An oldtimer's APL code

An oldtimer's APL code

What

Some pretty cool code from the 70s'-80s' that a Reddit user shared at this question.

Here's what u/snarkuzoid wrote:

5x5 Knight's Tour in APL

It puts an A in the middle, then randomly does a knight's tour,