Skip to content

Instantly share code, notes, and snippets.

View Wirtos's full-sized avatar

Wirtos_new Wirtos

  • L'viv, Ukraine
View GitHub Profile
@Wirtos
Wirtos / binary_to_braille_map.h
Created April 12, 2021 20:12
byte's binary representation to braille pattern map + generator code
#include <stdint.h>
const char braille_map[256][3] = {
"⠀",
"⠁", "⠂", "⠃", "⠄", "⠅", "⠆", "⠇", "⡀", "⡁", "⡂", "⡃", "⡄", "⡅", "⡆", "⡇", "⠈", "⠉",
"⠊", "⠋", "⠌", "⠍", "⠎", "⠏", "⡈", "⡉", "⡊", "⡋", "⡌", "⡍", "⡎", "⡏", "⠐", "⠑", "⠒",
"⠓", "⠔", "⠕", "⠖", "⠗", "⡐", "⡑", "⡒", "⡓", "⡔", "⡕", "⡖", "⡗", "⠘", "⠙", "⠚", "⠛",
"⠜", "⠝", "⠞", "⠟", "⡘", "⡙", "⡚", "⡛", "⡜", "⡝", "⡞", "⡟", "⠠", "⠡", "⠢", "⠣", "⠤",
"⠥", "⠦", "⠧", "⡠", "⡡", "⡢", "⡣", "⡤", "⡥", "⡦", "⡧", "⠨", "⠩", "⠪", "⠫", "⠬", "⠭",
"⠮", "⠯", "⡨", "⡩", "⡪", "⡫", "⡬", "⡭", "⡮", "⡯", "⠰", "⠱", "⠲", "⠳", "⠴", "⠵", "⠶",
"⠷", "⡰", "⡱", "⡲", "⡳", "⡴", "⡵", "⡶", "⡷", "⠸", "⠹", "⠺", "⠻", "⠼", "⠽", "⠾", "⠿",
@Wirtos
Wirtos / libtguy_python.py
Last active January 19, 2022 19:49
short example on how you can use libtguy from python while retaining the "pythonic" style
import sys
from ctypes import c_void_p, c_char_p, c_size_t, c_uint, POINTER, CDLL, create_string_buffer, Structure
from typing import Sequence, Union
# ###########TYPES#####################################################
class TGStrView(Structure):
_fields_ = [('str', c_char_p), ('len', c_size_t)]
def __repr__(self):