Skip to content

Instantly share code, notes, and snippets.

View cmdneo's full-sized avatar
😶‍🌫️
Undefined Behaviour

CMD AMIY cmdneo

😶‍🌫️
Undefined Behaviour
  • Floppyyy
View GitHub Profile
@cmdneo
cmdneo / maze-gen.py
Last active January 14, 2020 12:00
Generates png maze with solution. CLI args -s SIZE of maze. (DEV)
import png
import sys
import time
import math
import random
import argparse
import svgwrite
class Point2d:
@cmdneo
cmdneo / ansi-cols.py
Last active December 31, 2019 14:08
Prints a bunch of random 24-bit colors(3 char width) to the terminal using ansi escsape codes.
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 December 23, 2019 12:34
Just an experimemt with sound. Produces a sound similar to used in old games. Formula: 10 * sqrt(x)
"""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 July 8, 2019 19:20 — forked from robmint/gist:4753401
Basic linux framebuffer graphics setup
#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>