Skip to content

Instantly share code, notes, and snippets.

View volgar1x's full-sized avatar

Antoine Chauvin volgar1x

View GitHub Profile
@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' => [
import sys
with open('ch7.bin') as f:
data = "".join(f.readlines())
for shift in range(0, 255):
sys.stdout.write('%d >>> ' % shift)
for i in range(0, len(data)):
sys.stdout.write(chr((ord(data[i])+shift) % 255))
sys.stdout.write('\n')
def _get_lines(self, form):
res = []
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\
res_partner.name AS name \
FROM res_partner,account_move_line AS l, account_account, account_move am\
WHERE (l.account_id=account_account.id) \
AND (l.move_id=am.id) \