Skip to content

Instantly share code, notes, and snippets.

View timClicks's full-sized avatar
🏠
Working from home

Tim McNamara timClicks

🏠
Working from home
View GitHub Profile
use std::collections::BinaryHeap;
use std::sync::{
mpsc::{channel, Receiver, Sender},
Arc, Mutex,
};
use std::thread;
use std::time::Duration;
#[derive(Debug, Ord, PartialOrd, PartialEq, Eq)]
enum Task {
@timClicks
timClicks / Cargo.toml
Created September 2, 2023 10:39
Using Rust's MPSC channels to create a system monitoring utility
[package]
name = "tmon"
version = "0.1.0"
edition = "2021"
description = "Code used in this (https://www.youtube.com/live/mVyNAwzj5mA?si=vk-4qPsFlT4x3g6Z) tutorial"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sysinfo = "0.29"
@timClicks
timClicks / lol.c
Last active February 16, 2024 08:14
How many bugs can you spot?
// By [Colin Finck] and used by the [Comprehensive Rust] course,
// developed by the Android team at Google.
//
// This code compiles warning-free at the default warning level,
// even in the latest GCC version (13.2 as of writing).
//
// [Colin Finck]: https://colinfinck.de/Master_Thesis_Slides.pdf
// [Comprehensive Rust]: https://github.com/google/comprehensive-rust
#include <stdio.h>
@timClicks
timClicks / Cargo.toml
Last active November 28, 2023 23:32
async chat server
[package]
name = "chat"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures-util = { version = "0.3.28", features = ["sink"] }
http = "0.2.9"
@timClicks
timClicks / README.md
Created May 9, 2024 09:41
Lints used across all Rust crates on crates.io Data from "Lints to add to your crates"

Lints used across all Rust crates

What is this? See this 4 minute video https://www.youtube.com/watch?v=dJiL9gHNgKU

Description

denials.tsv is the source data generated from searching through every crate. lints-ranked-by-usage.txt provides an indication of how popular each lint is.

It's produced with this shell pipeline: