This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import types | |
import dis | |
import inspect | |
bin_op: dict[str,int] = {v[1]: i for i, v in enumerate(dis._nb_ops)} | |
def op(code_name: str, arg: int = 0) -> (int, int): | |
return dis.opmap[code_name], arg | |
code_ints = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def obj_from_id(obj_id: int): | |
# <https://stackoverflow.com/a/15702647> | |
return ctypes.cast(obj_id, ctypes.py_object).value | |
def print_referrers_tree(obj_id: int, level=0, prev_ids: set[int] | None = None) -> None: | |
if prev_ids is None: | |
prev_ids = set[int]() | |
if level > 20: | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <string_view> | |
#include "WsfPythonNaming.hpp" | |
void Foo() | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct FuncHolder | |
{ | |
std::function<void(double)> mFunc; | |
}; | |
py::class_<FuncHolder> funcHolder(aModule, "FuncHolder"); | |
aModule.def("AddCallback", [](std::function<void(double)> func, py::list aHolder) | |
{ | |
FuncHolder* holder = new FuncHolder{ func }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define PYBIND11_HANDLE_REF_DEBUG | |
#include <pybind11/pybind11.h> | |
#include <pybind11/operators.h> | |
namespace py = pybind11; | |
using namespace pybind11::literals; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import Tag, BeautifulSoup | |
import requests | |
from pathlib import Path | |
def get_todays_page(): | |
page = requests.get('https://www.astrobin.com/iotd/archive/') | |
soup = BeautifulSoup(page.content, 'html.parser') | |
image_html: Tag = soup.find('div', class_="iotd-archive-image") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct AuxData | |
{ | |
virtual ~AuxData() = default; | |
virtual void PrintAuxData() | |
{ | |
std::cout << "AuxData a: " << a << " b: " << b << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.12) | |
function(print_list lines header) | |
message(STATUS "** ${header} ***") | |
foreach(line ${lines}) | |
message(STATUS "\t" ${line}) | |
endforeach() | |
message(STATUS "** End ${header} ***") | |
endfunction(print_list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Location /kibana/> | |
ProxyPass http://kibana:5601/ | |
ProxyPassReverse http://kibana:5601/ | |
</Location> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logspout portion of the ELK Demo locally | |
# Maintainer: Gary A. Stafford <[email protected]> | |
version: '3.1' | |
services: | |
elk: | |
image: garystafford/custom-elk:latest | |
ports: | |
- "5601:5601/tcp" # Kibana web interface | |
- "9200:9200/tcp" # Elasticsearch JSON interface |
NewerOlder