Skip to content

Instantly share code, notes, and snippets.

Avatar
😶‍🌫️
Undefined Behaviour

CMD AMIY cmdneo

😶‍🌫️
Undefined Behaviour
  • Somewhere
View GitHub Profile
@cmdneo
cmdneo / maze-gen.py
Last active Jan 14, 2020
Generates png maze with solution. CLI args -s SIZE of maze. (DEV)
View maze-gen.py
import png
import sys
import time
import math
import random
import argparse
import svgwrite
class Point2d:
@cmdneo
cmdneo / ansi-cols.py
Last active Dec 31, 2019
Prints a bunch of random 24-bit colors(3 char width) to the terminal using ansi escsape codes.
View ansi-cols.py
r"""Prints random 24-bit colors(3 char width)
to the terminal using ansi escsape codes.
Use like:
python ansi-cols.py NO_OF_COLORED_CELLS
Example:
python ansi-cols.py 69_420
"""
@cmdneo
cmdneo / retro-rocket.py
Created Dec 23, 2019
Just an experimemt with sound. Produces a sound similar to used in old games. Formula: 10 * sqrt(x)
View retro-rocket.py
"""Formula used: Frequency / Sample_rate * 10 * math.sqrt(x)
x is [0, Duration * Sample_rate)
"""
import wave
import struct
import math
def fpart(val):
@cmdneo
cmdneo / gist:183b0623d2402dc53f5982dac867b0c0
Created Jul 8, 2019 — forked from robmint/gist:4753401
Basic linux framebuffer graphics setup
View gist:183b0623d2402dc53f5982dac867b0c0
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <linux/input.h>