Skip to content

Instantly share code, notes, and snippets.

View kostja's full-sized avatar
🐢
Working from home

Konstantin Osipov kostja

🐢
Working from home
View GitHub Profile
@kostja
kostja / lightweight shared pointer
Created August 15, 2019 18:27
lightweight shared pointer
#include <stdio.h>
#include <new>
template <typename T>
struct lw_shared_ptr {
struct Mem {
int counter;
T value;
};
#include <stdio.h>
#include <new>
template <typename T>
struct lw_shared_ptr {
char *_mem;
void destroy() {
package main
import (
"bytes"
"fmt"
"github.com/gocql/gocql"
"log"
"reflect"
)
@kostja
kostja / test.py
Last active November 19, 2019 15:32
test.py
kostja@hulk ~ % ./test.py
^CShutdown requested
/usr/lib/python3.7/asyncio/unix_events.py:861: RuntimeWarning: A loop is being detached from a child watcher with pending handlers
RuntimeWarning)
/usr/lib/python3.7/asyncio/unix_events.py:137: RuntimeWarning: coroutine 'setup_signal_handlers.<locals>.shutdown' was never awaited
del self._signal_handlers[sig]
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
File "./test.py", line 59, in <module>
asyncio.run(main())