Skip to content

Instantly share code, notes, and snippets.

View nazmulidris's full-sized avatar
🤙
❯ Write Rust 🦀 for r3bl-open-core ❯ rec 📹 live code vids developerlife YT chan

Nazmul Idris nazmulidris

🤙
❯ Write Rust 🦀 for r3bl-open-core ❯ rec 📹 live code vids developerlife YT chan
View GitHub Profile
@nazmulidris
nazmulidris / intro_r3bl_tui.md
Last active November 8, 2023 04:30
intro_r3bl_tui
@nazmulidris
nazmulidris / intro_ockam.md
Last active November 3, 2023 17:05
intro_ockam

We are developing a new desktop app for Ockam and I was wondering if you would be interested in getting super early access to it and maybe sharing some feedback about it?

It currently only runs on macOS so if you have a Mac and would like to try it ... let me know your email and I'll send you an invitation.

@nazmulidris
nazmulidris / UserConfiguration.json
Last active June 19, 2023 19:54
uhk v2 user configuration for issue repro
{
"userConfigMajorVersion": 5,
"userConfigMinorVersion": 0,
"userConfigPatchVersion": 0,
"deviceName": "NAZ-UHK",
"doubleTapSwitchLayerTimeout": 250,
"iconsAndLayerTextsBrightness": 255,
"alphanumericSegmentsBrightness": 255,
"keyBacklightBrightness": 255,
"mouseMoveInitialSpeed": 1,
@nazmulidris
nazmulidris / color_wheel.rs
Created February 24, 2023 03:38
Edits to color_wheel.rs WIP
/*
* Copyright (c) 2023 R3BL LLC
* All rights reserved.
*
* 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
*
@nazmulidris
nazmulidris / readme.md
Last active January 5, 2023 21:44
Instructions to setup & run R3BL TUI engine

I have built the "TUI engine" & hosted it on github & published it to crates.io. Feel free to check them out here:

The R3BL CMDR product, and R3BL BASE product have not been built. I am securing funding in order to be able to build them :). Here are some instructions on how you can run the demo on your own machine (macOS, Windows, or Linux).

@nazmulidris
nazmulidris / problem_01.md
Last active January 2, 2023 03:33
interview questions

Problem

Write a function which given a string argument, returns a count the occurences of each word in that string.

  • A string represents a single line of text.
  • A word is defined as a sequence of characters that are delimited by , or ,, or ;, or ..
  • To count as an occurence, there has to be a full word match (not a partial match).

Input

the monkey donkey donkey monkey a face

@nazmulidris
nazmulidris / rate_limit.rs
Last active November 15, 2022 08:14
Snippet for impl rate limiter
/// Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7f2ff17ff7ae239924d11698d12a69f9
mod rate_limiter {
#[test]
fn test() {
const MAX_REQ_ALLOWED_IN_WINDOW: usize = 2;
const WINDOW_SIZE_MS: usize = 1000;
#[derive(Debug, /* deep copy support */ Clone, /* deep equality support */ PartialEq)]
enum RateLimitCheck {
@nazmulidris
nazmulidris / readme.md
Created April 27, 2022 19:36
Delete updater account
@nazmulidris
nazmulidris / promise.test_1.ts
Last active February 10, 2022 00:57
snippet showing promise rejection in a test using try and catch
test("test foo", async () => {
function createPromiseThatRejects(): Promise<void> {
return new Promise<void>((_, rejectFn) => {
setTimeout(() => {
rejectFn(new Error("Rejected"))
}, 1_000)
})
}
expect(createPromiseThatRejects()).rejects.toThrow("Rejected")
@nazmulidris
nazmulidris / promise.test.ts
Created January 28, 2022 00:33
deep dive into jest & promise creation
/*
* Copyright (c) 2022 R3BL LLC. All rights reserved.
*
* 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