Skip to content

Instantly share code, notes, and snippets.

View Yoric's full-sized avatar

David Teller Yoric

View GitHub Profile
@Yoric
Yoric / snippet.rs
Created March 28, 2025 09:52
Rust comments
async fn insert_with<F>(&self, key: Key, future: F) -> FetchResult
where
F: Future<Output = FetchResult>,
{
// Each `OnceCell` represents a fetch task, either complete, in progress, or (if we create it) about to start.
let once = {
let mut store = self.store.lock().await;
store
.entry(key.clone())
.or_insert_with(|| Arc::new(OnceCell::new()))
{
"content": {
"body": "XXX",
"format": "org.matrix.custom.html",
"formatted_body": "XXX",
"msgtype": "m.notice",
"org.matrix.msc1767.html": "XXX",
"org.matrix.msc1767.text": "XXX"
},
"origin_server_ts": 1669813978182,
{
"content": {
"body": "XXX",
"format": "org.matrix.custom.html",
"formatted_body": "XXX",
"m.new_content": {
"body": "XXX",
"format": "org.matrix.custom.html",
"formatted_body": "XXX",
"msgtype": "m.notice",
@Yoric
Yoric / docker.log
Created January 18, 2022 14:23
Docker logs
$ journalctl -fu docker
-- Logs begin at Sat 2021-08-07 23:57:33 CEST. --
janv. 18 15:19:42 Orchestra dockerd[192417]: time="2022-01-18T15:19:42.189735162+01:00" level=info msg="ignoring event" container=f4f34cbcb21b9f822fda5f8bb52020e7e4ba4dc12fcb0d392aabfa64cbf08da0 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
janv. 18 15:19:45 Orchestra dockerd[192417]: time="2022-01-18T15:19:45.321429976+01:00" level=info msg="ignoring event" container=06ee661b83c9ec614e5db74e22f1a708daedbbf7cf8be995e6af1125d8344e30 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
janv. 18 15:19:48 Orchestra dockerd[192417]: time="2022-01-18T15:19:48.157501518+01:00" level=info msg="ignoring event" container=748b434cb8d24a791f2700d28100e27deb33b38ec649041cc9f450b968ffbf37 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
janv. 18 15:19:51 Orchestra dockerd[192417]: time="2022-01-18T15:19:51.381467768+01:00" level=info msg="ignoring event"
@Yoric
Yoric / user_limits.rs
Created January 10, 2022 15:54
User Limits
mod override_rate_limits {
use matrix_sdk::ruma::api::ruma_api;
use matrix_sdk::ruma::UserId;
use serde::{Deserialize, Serialize};
ruma_api! {
metadata: {
description: "Override rate limits",
method: POST,
@Yoric
Yoric / error.log
Created December 21, 2020 12:23
Synapse log
synapse_1 | Traceback (most recent call last):
synapse_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
synapse_1 | conn = connection.create_connection(
synapse_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
synapse_1 | raise err
synapse_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
synapse_1 | sock.connect(sa)
synapse_1 | ConnectionRefusedError: [Errno 111] Connection refused
synapse_1 |
synapse_1 | During handling of the above exception, another exception occurred:
@Yoric
Yoric / Dockerfile
Last active December 17, 2020 13:53
matrix Dockerfile
FROM matrixdotorg/synapse:latest
# Install extension.
WORKDIR /tmp/iwf-filter
COPY . .
RUN pip install .
# Customize homeserver.yaml
CREATE SCHEMA IF NOT EXISTS image_filter;
CREATE TABLE IF NOT EXISTS image_filter.iwf_links (
url TEXT PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS image_filter.iwf_md5 (
md5 TEXT PRIMARY KEY
);
@Yoric
Yoric / ordre.md
Last active March 24, 2020 12:35

Téléphone téléphonique !

  1. Marceau
  2. Aldous
  3. Maylo
  4. Victor
  5. Iris
  6. Basil
  7. Anton
  8. Charlotte

--------------- | ------- | ------------------------------------------------------------------- 10.67 s 6.0% | 10.67 s | decltype(auto) mozilla::detail::VariantImplementation, (unsigned char)6>, js::frontend::MultiLookupHuffmanTable, (unsigned char)6>, (unsigned char)6>, js::frontend::HuffmanTableUnreachable>::matchN, js::frontend::MultiLookupHuffmanTable, (unsigned char)6>, js::frontend::MultiLookupHuffmanTable, (unsigned char)6>, (unsigned char)6>, js::frontend::HuffmanTableUnreachable> const, js::frontend::GenericHuffmanTable