Skip to content

Instantly share code, notes, and snippets.

View mb6ockatf's full-sized avatar

mb6ockatf

View GitHub Profile
print("hello world")
@mb6ockatf
mb6ockatf / clear.b
Created June 20, 2023 19:32
clear terminal screen - BF
++++++++++[>++++++++++>+<<-]>[>.<-]
@mb6ockatf
mb6ockatf / powers.b
Created June 20, 2023 19:32
powers of two in BF - does not terminate
>++++++++++>>+<+[[+++++[>++++++++<-]>.<++++++[>--------<-]+<<]>.>[->[
<++>-[<++>-[<++>-[<++>-[<-------->>[-]++<-[<++>-]]]]]]<[>+<-]+>>]<<]
@mb6ockatf
mb6ockatf / beep.bf
Created June 20, 2023 19:34
ring terminal bell with BF
+++++++.
@mb6ockatf
mb6ockatf / balls_equillib.py
Created August 9, 2023 21:35
stunning pygame simulation
#!/usr/bin/env python3
from argparse import ArgumentParser
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
parser = ArgumentParser(prog="balls-equilibrium",
description="nice pygame simulation")
parser.add_argument("--width", type=int, default=200)
#!/usr/bin/env python3
"""
Script to select telegram chat history dump in json format
Dump consists of chat's information (name, members, etc).
chat["messages"] is usually the biggest value there.
It is a list of all messages sent (except the ones which were deleted)
Every message is a dictionary, too.
Example message:
{'date': '2029-06-33T05:33:11',
'date_unixtime': '1455555555',
@mb6ockatf
mb6ockatf / bf.cpp
Created December 2, 2023 07:56
cpp brainfuck interpreter
#include <fstream>
#include <iostream>
#include <iterator>
#include <vector>
int main(int argc, char **argv)
{
std::fstream file(argv[1], std::ios::in);
std::istreambuf_iterator<char> fstart(file), fend;
std::vector<unsigned char> itape(fstart, fend);
@mb6ockatf
mb6ockatf / euclid_gcd.lua
Created December 2, 2023 07:57
greatest common divisor by euclid
#!/usr/bin/env lua
euclid_gcd = {}
function euclid_gcd.var1(m, n)
local r = 1
while r ~= 0 do
r = m % n
m = n
n = r
@mb6ockatf
mb6ockatf / grub.sh
Created December 2, 2023 07:58
uupdate grub config the right way
#!/usr/bin/env bash
sudo vim /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
-- JOIN
SELECT customer.first_name, customer.last_name,
time(rental.rental_date) as rental_time
FROM customer-- as c
INNER JOIN rental -- as r
ON customer.customer_id = rental.customer_id -- USING customer_id
WHERE date(rental.rental_date) = "2005-06-14";
-- TEMP TABLE
CREATE TEMPORARY TABLE actors_j