Skip to content

Instantly share code, notes, and snippets.

@ilijaljubicic
ilijaljubicic / .cursorrules
Created May 31, 2025 21:33 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors

General Caches

  • kmem_cache: internal cache of cache description objects
  • size-N: Generic cache of size N
  • size-N(DMA): Generic cache of size N for direct memory access use

Networking

  • flow_cache: Generic flow cache
  • RPC
    • rpc_buffers: RPC requests, data buffers
    • rpc_tasks: RPC requests, task structures

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@ilijaljubicic
ilijaljubicic / gist:78402207284f96767c61401d91143a1f
Created May 24, 2017 19:10
Monad Laws Example on scala List Monad
/*
Monads laws examples with List monads
Summary from article: https://devth.com/2015/monad-laws-in-scala
*/
val f: (Int => List[Int]) = x => List(x - 1, x, x + 1)
@ilijaljubicic
ilijaljubicic / ddbench.sh
Created March 30, 2016 13:10 — forked from iMilnb/ddbench.sh
Trivial disk troughput bench using dd(1)
#!/bin/sh
[ $# -lt 1 ] && echo "usage: $0 <path>" && exit 1
bpath=$1
# you might want to change these to suit your setup
bs=32k
count=30000