Skip to content

Instantly share code, notes, and snippets.

View yamafaktory's full-sized avatar

Davy Duperron yamafaktory

View GitHub Profile
@sts10
sts10 / rust-command-line-utilities.markdown
Last active April 18, 2025 21:11
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
// Please find the full, tested version in
// https://github.com/influxdata/influxdb_iox/blob/fe155e15fb2ad166aee66b0458e63c24a8128dd4/query/src/exec/task.rs#L101-L118
pub struct DedicatedExecutor {
state: Arc<Mutex<State>>,
}
/// Runs futures (and any `tasks` that are `tokio::task::spawned` by
/// them) on a separate Tokio Executor
struct State {
@jasnell
jasnell / index.js
Created May 24, 2021 21:58
Getting loopy with JavaScript
'use strict';
const {
createHistogram,
performance: {
timerify
}
} = require('perf_hooks');
const users = [
@snoyberg
snoyberg / transformers.rs
Created December 2, 2020 08:39
Transformers: Rust in disguise
#![feature(generic_associated_types)]
trait Functor {
type Unwrapped;
type Wrapped<A>: Functor;
fn map<F, B>(self, f: F) -> Self::Wrapped<B>
where
F: FnOnce(Self::Unwrapped) -> B;
}
@maretekent
maretekent / permutations.rs
Last active September 13, 2018 08:02
Rust algorithm to get permutations in a number
use std::fmt;
pub struct JoinMyVec {
myvec : Vec<u32>,
}
impl fmt::Display for JoinMyVec {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let s = fmt.write_str(&join(&self.myvec[..], &""))?;
Ok(s)
@autodidaddict
autodidaddict / threads.rs
Created March 5, 2018 19:28
Mutating Data with Multiple Threads in Rust - Channels vs Mutexes
use std::thread::spawn;
use std::sync::Arc;
use std::sync::Mutex;
use std::sync::mpsc;
#[derive(Debug)]
struct Transaction {
amount: isize,
timestamp: u64,
txid: String,

Get $h*t Done! - How to survive in a world of distractions

Why

Morpheus: You have to let it all go, Neo. Fear, doubt, and disbelief. Free your mind.

We live in a world full of distractions - both in our private and professional lives. I'll show you how to keep track of things and focus on what really matters.

Vote for this talk by pushing the ⭐ Star button ↗ on the top right ↗

// Suppose you have a variable named `future` which implements the `Future` trait.
let future: impl Future = ...;
// This gist demonstrates how to run the future until completion using the `stdweb` crate.
// The various imports.
extern crate futures;
extern crate stdweb;
#![feature(lang_items)]
#![no_std]
#[no_mangle]
pub fn add_one(x: i32) -> i32 {
x + 1
}
// needed for no_std