Skip to content

Instantly share code, notes, and snippets.

View traverseda's full-sized avatar

traverseda traverseda

  • Halifax, Nova Scotia, Canada
View GitHub Profile
cmake_minimum_required(VERSION 3.17)
project(imgui LANGUAGES CXX)
execute_process(COMMAND cling-config --cmake OUTPUT_VARIABLE CPPYY_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
# Make sure this is set to something like:
# ~/.local/lib/python2.7/site-packages/cpyy_backend/cmake
message("CPYY_MODULE_PATH: " ${CPPYY_MODULE_PATH})
list(INSERT CMAKE_MODULE_PATH 0 ${CPPYY_MODULE_PATH})
find_package(Cppyy)
cmake_minimum_required(VERSION 3.17)
project(imgui LANGUAGES CXX)
execute_process(COMMAND cling-config --cmake OUTPUT_VARIABLE CPPYY_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
# Make sure this is set to something like:
# ~/.local/lib/python2.7/site-packages/cpyy_backend/cmake
message("CPYY_MODULE_PATH: " ${CPPYY_MODULE_PATH})
list(INSERT CMAKE_MODULE_PATH 0 ${CPPYY_MODULE_PATH})
find_package(Cppyy)
import argparse
import asyncio
import logging
import math
import cv2
import numpy
from av import VideoFrame
from aiortc import (
"""A type-hinted messagepack-like serializer for immutable python types.
Could be extended to a generic type-hinted messagepack serializer without too much trouble.
If you need that, feel free to reach out.
https://github.com/msgpack/msgpack/blob/master/spec.md
"""
from typing import Union, Tuple, FrozenSet
baseImmutableTypes = Union[str,int,bool,float,bytes,slice,complex,None] #Ellipsis?

Pynto

PYthon Network Transparent Objects

A "remote object" interface inspired by rpyc.

This lets you access a python object running in a different process as if it was local, and running in your process. This is great for quickly prototyping new software. A chat server can be as simple as exposing a list object and letting users append their messages to it.

This is a proposal, no code has actually been written yet.

A python preprocessor that extends python syntax to make it easier to use python as a bash replacement.

Inspired by xonsh, we first determine if something should be running in "shell" mode or python mode.

print hello world #Shell mode
#Run using `python catcher.py python asyncServer.py /home/traverseda`
import rpyc, sys, pathlib, os, math
class FileListingService(rpyc.Service,pathlib.PosixPath):
def on_connect(self, conn):
self._conn = conn
sys.stdout = conn.root.stdout
pass
def on_disconnect(self, conn):
src
├── build.rs
├── main.rs
└── schema
└── baseComponents.capnp
1 directory, 3 files
@traverseda
traverseda / download.py
Last active January 26, 2019 21:47
Archive bbcode on sufficient velocity.
import requests, lxml
from lxml.etree import tostring
import lxml.html
import html2text
bbUrl = "https://forums.sufficientvelocity.com/posts/{postId}/quote"
session = requests.Session()
session.headers.update({'User-Agent': 'WithThisRing downloader'})
from camel import CamelRegistry, Camel
from bs4 import BeautifulSoup
import bs4
html_types = CamelRegistry()
@html_types.dumper(BeautifulSoup, 'xml', version=1)
@html_types.dumper(bs4.element.Tag, 'xml', version=1)
def _dump_tag(tag):
out = dict(