Skip to content

Instantly share code, notes, and snippets.

View aksh1618's full-sized avatar

Aakarshit Uppal aksh1618

View GitHub Profile
@aksh1618
aksh1618 / clippy-greatest-hits.toml
Created May 13, 2025 05:01
Clippy lint configuration curated for those getting started with serious projects in Rust. Just drop it at the end of your Cargo.toml!
[lints.clippy]
#################################### Warns #####################################
#--- suspicious, complexity, perf & style groups are warn-by-default
#--- set entire pedantic group to warn (pedantic is intended for opt-outs)
pedantic = { level = "warn", priority = -1 } # feel free to #[allow] specific lints in code
nursery = { level = "warn", priority = -1 }
#--- set selective lints from restriction group to warn (restriction is intended for opt-ins)
# restriction = { level = "warn", priority = -1 }
absolute_paths = "warn" # clippy.toml: `absolute-paths-max-segments = 2`
allow_attributes = "warn"
@aksh1618
aksh1618 / rust-deep-dive-pinning.md
Last active May 11, 2025 08:49
Rust Deep Dive - Pinning 📌

Rust Deep Dive - Pinning 📌

If a Pin drops in a room, and nobody around understands it, does it make an unsound?

Josh Triplett

Introduction

Pre-reqs

  • Auto traits: Traits that rust automatically implements for primitives and anything with all constituents (e.g. fields of a struct) implementing that trait.
  • Existence of std::mem::swap implies that ability to gain mutable ref means ability to move
@aksh1618
aksh1618 / ctrl-tab-in-chromium-browsers.md
Created March 30, 2025 15:21
Steps for adding Ctrl+Tab support in Chromium based browsers (Chromium, Google Chrome, Edge etc.)

Ctrl + Tab in Chromium Based Browsers

  1. Install the CLUT: Cycle Last Used Tabs extension (e.g. from chrome web store)
  2. Go to Manage Extensions page (chrome://extensions/shortcuts)
  3. Open console (Right Click -> Inspect -> Tab named "Console")
  4. Past this script, and press Enter:
    // Find the id and command for the CLUT extension in this chromium based
    // browser. It will run something like:
    // chrome.developerPrivate.updateExtensionCommand({
    //     extensionId: "cobieddmkhhnbeldhncnfcgcaccmehgn",
@aksh1618
aksh1618 / rust-deep-dive-error-handling.md
Last active January 4, 2025 06:38
Rust Deep Dive - Error Handling 🐦‍🔥

Rust Deep Dive - Error Handling 🐦‍🔥

Slide from a talk by Jane Losare-Lusby, who maintains the `eyre` crate

Slide from a talk by Jane Losare-Lusby, who maintains the eyre crate

@aksh1618
aksh1618 / badram_to_memmap.rs
Last active December 10, 2023 12:31
Convert BadRAM to memmap
// Rust playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7c51f91cfddb501bd24fdaa6d7238d80
const PAGESIZE: u64 = 4096;
const MIN_SIZE_KIB: u64 = 4;
fn main() {
println!("Enter BadRAM string. It must be a single line of comma separated");
println!("values, with address and mask alternating. This is basically the");
println!("badram output from memtest86+ et al with all values in a single");
println!("line without the `badram=` prefix.");
  • Reactive Streams Spec: The purpose of Reactive Streams is to provide a standard for asynchronous stream processing with non-blocking backpressure.
    • Publisher:
      void subscribe(Subscriber<? super T> s)
    • Subscriber:
      void onSubscribe(Subscription s);
      void onNext(T t);

void onError(Throwable t);

@aksh1618
aksh1618 / JsonContentCachingRequestWrapper.java
Created December 28, 2021 09:27
A variation of ContentCachingRequestWrapper for JSON POST data instead of FORM POST data
/*
* Copyright 2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@aksh1618
aksh1618 / spring-reactive-talks-notes.md
Last active January 24, 2022 11:27
Spring Reactive Talks + Notes
@aksh1618
aksh1618 / contribute-to.md
Last active May 9, 2021 12:26
Projects to contribute to
@aksh1618
aksh1618 / tools.md
Last active June 9, 2021 12:01
Tools