Skip to content

Instantly share code, notes, and snippets.

View nulltier's full-sized avatar
💭
on my way

Alexander Zonov nulltier

💭
on my way
  • Yandex
View GitHub Profile
@nulltier
nulltier / test-case-template.rs
Last active August 27, 2022 23:20
Rust template for the HackerRank tasks
// Enter your code here
use std::io;
#[derive(Debug)]
enum Case {
TwoLines(String, String)
}
fn readStdin() -> Vec<String> {
let mut result: Vec<String> = Vec::new();
@nulltier
nulltier / memoization.rs
Created February 8, 2022 22:35
Rust function with memoization
struct Memoize<'a, A, R> {
cache: std::collections::HashMap<A, R>,
func: &'a dyn Fn(A) -> R
}
impl<'a, A, R> Memoize<'a, A, R> where
A: Eq + std::hash::Hash + Copy + Clone,
R: Copy + Clone
{
fn from_func(func: &'a dyn Fn(A) -> R) -> Self {
@nulltier
nulltier / AutoHotkey.ahk
Last active January 9, 2022 15:31
my autohotkey configuration, hotkeys
; <! - left alt-key
; ^ - ctrl-key
; + - shift-key
; sc021 - W
; sc010 - D
; sc011 - F
; sc014 - T
; sc013 - R
; sc024 - J
; sc025 - K