Skip to content

Instantly share code, notes, and snippets.

View Kerollmops's full-sized avatar
🍼
Meilisearch needs care

Clément Renault Kerollmops

🍼
Meilisearch needs care
View GitHub Profile
@Kerollmops
Kerollmops / to-title-case.rhai
Created May 9, 2024 21:17
A Rhai little function to title case strings
// Meilisearch is setting the document for you, this way.
let doc = #{ title: "star wars" };
print(doc);
// -- script starts here --
fn to_title_case() {
let title_cased = "";
let must_upper_case = true;
@Kerollmops
Kerollmops / keymap.json
Last active April 25, 2024 14:47
This is my zed keymap who fake the Sublime Text ones as mush as possible.
[
{
"bindings": {
"cmd-shift-[": "pane::ActivatePrevItem",
"cmd-shift-]": "pane::ActivateNextItem",
"ctrl-pagedown": "pane::ActivatePrevItem",
"ctrl-pageup": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivateNextItem",
"ctrl-tab": "pane::ActivatePrevItem",
"cmd-+": "zed::IncreaseBufferFontSize"
@Kerollmops
Kerollmops / pushover.sh
Created December 9, 2023 10:10
A very simple bash/shell function to push messages through pushover
# Create an API KEY there: https://pushover.net/apps/build
# Find your user TOKEN here: https://pushover.net
#
# Note that the `title` field is optional and don't forget to put double quotes
# around your argument when calling this function.
#
# Here is a small example of pipping logs through pushover:
#
# nohup tail -f nohup.out | while read l; do pushover "$l"; done &
#
@Kerollmops
Kerollmops / par_build_tree.cpp
Last active December 15, 2023 16:29
Using Spotify/Annoy to index some vectors in parallel
/*
* par_build_tree.cpp
*
* Move this in the examples folder of Annoy and compile it like the other c++ example.
*
* Created on: Dec 6, 2023
* Author: Clément Renault
*/
@Kerollmops
Kerollmops / keymap.json
Last active July 5, 2023 15:24
The settings I use in https://zed.dev
{}
@Kerollmops
Kerollmops / index-stats.rs
Created June 21, 2023 14:16
A small program that computes the stats of an LMDB Meilisearch index.
//! A small program that computes the stats of an LMDB Meilisearch index.
//!
//! ```cargo
//! [dependencies]
//! anyhow = "1.0.71"
//! clap = { version = "4.3.5", features = ["derive"] }
//! heed = "0.20.0-alpha.1"
//! ```
use std::path::PathBuf;
@Kerollmops
Kerollmops / valid_I_25.fillit.md
Last active March 19, 2021 17:36
Fillit timings experiments - AMD EPYC 7401P 24- (4) @ 1.996GHz

Julow - 140h+

Never finished...

Rust - 140h+

Never finished...

Rust #2 - 281m34.146s

@Kerollmops
Kerollmops / export-imdb-sqlite.md
Last active January 23, 2023 16:15
Export a nd-JSON/JSON stream from the multiple IMDB TSVs
@Kerollmops
Kerollmops / rsync-ssh.sh
Created March 19, 2020 10:14
Remote sync a cargo repository by using fswatch and ssh with a custom identity key.
fswatch --exclude '.git' --exclude 'target' . | while read num; do
rsync -azP --exclude=.git --exclude=target -e 'ssh -i ~/.ssh/id_rsa' . root@xxx.xxx.xxx.xxx:<DEST>
done
@Kerollmops
Kerollmops / iter_kit.rs
Last active January 6, 2020 17:43
A kit of simple adapter Iterators for tricky situations (no external library needed)
/// An adapter function that returns an iterator associated
/// to a boolean indicating if this is the first item returned.
///
/// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7ea95cd91a26de21c680ad7de8669c8d
///
/// ```
/// let words = ["Hello", "world", "!"];
/// let mut iter = is_first(&words);
///
/// assert_eq!(iter.next(), Some((true, "Hello")));