Skip to content

Instantly share code, notes, and snippets.

View dottharun's full-sized avatar
⚙️
:w

Tharun T dottharun

⚙️
:w
View GitHub Profile
@jboner
jboner / latency.txt
Last active May 12, 2025 05:04
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@JoelWi
JoelWi / java.lua
Last active January 6, 2025 08:11
local java_cmds = vim.api.nvim_create_augroup('java_cmds', {clear = true})
local cache_vars = {}
local root_files = {
'.git',
'mvnw',
'gradlew',
'pom.xml',
'build.gradle'
}
@ICE-GB
ICE-GB / eclipse-java-idea-style.xml
Last active January 9, 2025 13:51
eclipse-java-idea-style.xml
<?xml version="1.0" encoding="utf-8"?>
<profiles version="21">
<profile kind="CodeFormatterProfile" name="Default" version="21">
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
@aidenybai
aidenybai / fps-block.js
Created December 11, 2024 12:27
"fun" way to annoy your coworkers AND get them to care about performance (block all user interaction if FPS < 50)
(() => {
const fpsDiv = document.createElement('div');
fpsDiv.style.position = 'fixed';
fpsDiv.style.bottom = '0px';
fpsDiv.style.right = '0px';
fpsDiv.style.fontSize = '12px';
fpsDiv.style.backgroundColor = 'lightgreen';
fpsDiv.style.padding = '5px';
fpsDiv.style.zIndex = '9999';
fpsDiv.style.width = '50px';