Skip to content

Instantly share code, notes, and snippets.

View volgar1x's full-sized avatar

Antoine Chauvin volgar1x

View GitHub Profile
@volgar1x
volgar1x / stdout.log
Created October 10, 2024 13:06
aqora CLI w/ python3.12 debug build with ASAN
=================================================================
==63146==ERROR: AddressSanitizer: heap-use-after-free on address 0x00010cc2b3d0 at pc 0x000105d4b4c4 bp 0x000170577970 sp 0x000170577968
READ of size 8 at 0x00010cc2b3d0 thread T6
#0 0x105d4b4c0 in _PyThreadState_MustExit pystate.c:3049
#1 0x105cde1f4 in take_gil ceval_gil.c:346
#2 0x105cdf588 in PyEval_AcquireThread ceval_gil.c:634
#3 0x110f4c848 in pybind11::gil_scoped_acquire::gil_scoped_acquire()+0x5c (libtorch_python.dylib:arm64+0x48848)
#4 0x1113fe0b0 in (anonymous namespace)::ConcretePyInterpreterVTable::decref(_object*, bool) const+0x24 (libtorch_python.dylib:arm64+0x4fa0b0)
#5 0x10fb1d5ac in c10::impl::PyObjectSlot::~PyObjectSlot()+0x44 (libc10.dylib:arm64+0x415ac)
#6 0x11c938f08 in c10::StorageImpl::~StorageImpl()+0x20 (libtorch_cpu.dylib:arm64+0x18f08)
pub trait IteratorExt: std::iter::Iterator {
fn group_by<F, K, G>(self, f: F) -> HashMap<K, Vec<G>>
where
Self: Sized,
K: Eq + Hash,
F: FnMut(Self::Item) -> (K, G);
}
impl<T> IteratorExt for T
@volgar1x
volgar1x / Dockerfile
Created October 10, 2023 18:53
GraalVM CE 21: java.nio.file.InvalidPathException
FROM ghcr.io/graalvm/graalvm-community:21 AS build
WORKDIR /app
COPY NioPath.java .
RUN javac NioPath.java && native-image -Dsun.jnu.encoding=UTF-8 NioPath
FROM debian:12-slim AS production
COPY --from=build /app/niopath /bin/niopath
CMD ["/bin/niopath", "àéïõû.txt"]
@volgar1x
volgar1x / script.sh
Created November 28, 2019 12:58
/usr/bin/gnome-terminal
#!/bin/sh
if test "$1" = "-x"; then
shift
command=$@
/usr/bin/x-terminal-emulator -e sh -c "$command"
else
/usr/bin/x-terminal-emulator $@
fi
#!/bin/sh
set -x
youtube-dl -f140 --add-metadata -i $@
ctx.upstream().transact {
post(..., 10.second)
post(...)
}
@volgar1x
volgar1x / file.kt
Last active October 23, 2019 19:57
ctx.upstream().with {
post(a)
post(b)
...
}
struct thread_params {
shared_ptr<Store> store;
};
struct thread_params * p = new struct thread_params;
p->store = store;
CreateThread(&initThread, p)
typedef struct {
Element* start;
size_t len;
size_t cap;
} vector;
vector* vector_new () {
vector* vec = (vector*) malloc(sizeof(vec));
vec->cap = 10;
vec->start = (Element*) malloc(sizeof(Element) * vec->cap);
<?php
namespace SciMS;
use SciMS\Secure;
use SciMS\Model\User;
use SciMS\Model\ArticleQuery;
return [
'/articles' => [