USAGE:
python3 node_bindings.py djinni.yml <namespace> node/node.cpp
yarn
mkdir -p build-node
cd build-node; \
cmake .. -DCMAKE_BUILD_TYPE=Release -DNODE=yes; \
cmake --build . -j
node node/test.js
USAGE:
python3 node_bindings.py djinni.yml <namespace> node/node.cpp
yarn
mkdir -p build-node
cd build-node; \
cmake .. -DCMAKE_BUILD_TYPE=Release -DNODE=yes; \
cmake --build . -j
node node/test.js
import typing | |
from contextlib import suppress | |
from pathlib import Path | |
import logging | |
from logextension import LoggingContext | |
with LoggingContext(logging.getLogger("keyring.backend"), logging.ERROR): | |
import keyring.backend |
# python 'if' statement is priviliged to the boolean output of compound conditionals | |
# other statements are not, and have to double-evaluate the output | |
# unless the output is "the last one" | |
class X: | |
def __init__(self): | |
self.v = False | |
self.c = 0 | |
def __bool__(self): |
#!/usr/bin/env python | |
import sys | |
import re | |
import configparser | |
from fnmatch import fnmatch | |
from unidiff import PatchSet | |
EXTS = ["py"] |
#ifndef INCLUDED_QJSON_H | |
#define INCLUDED_QJSON_H | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <stdexcept> | |
#include <memory> | |
#include <algorithm> | |
#include <istream> |
/// replaced with better tested: github.com/earonesty/qserial | |
#include <vector> | |
#include <memory> | |
#include <algorithm> | |
namespace qserial { | |
/* | |
* Simple but limited schema-driven serialization, header-only, small + fast. |
import threading | |
class SafeWrap(): | |
""" | |
Wrap an unsafe sdk (like onedrivesdk, for example) in a thread lock. | |
Derive from this if you want to translate exceptions, or change the | |
type set | |
""" | |
__safe_types = (str, int, float, type(None), bool, bytes, type(iter(bytes())), type(iter(str()))) |
#!/usr/bin/env python | |
'''Delete local branches which have been merged via GitHub PRs. | |
Usage (from the root of your GitHub repo): | |
delete-squahsed-branches [--dry-run] | |
If you specify --dry-run, it will only print out the branches that would be | |
deleted. |
import fastjsonschema as fjs | |
from urllib import parse as urlparse | |
from hashlib import md5 | |
_schema_dir = os.path.dirname(__file__) | |
_file_loader = {'file': lambda f: json.loads(open(_schema_dir + "/" + urlparse.urlsplit(f).path.lstrip('/')).read())} | |
def gen_var_name(schema, step="format"): | |
x=schema.copy() |
import random | |
def scramble(gen, buffer_size): | |
buf = [] | |
i = iter(gen) | |
while True: | |
try: | |
e = next(i) | |
buf.append(e) | |
if len(buf) >= buffer_size: |