Skip to content

Instantly share code, notes, and snippets.

@rusev
rusev / playgrounds.txt
Created January 2, 2024 12:57 — forked from Andarist/playgrounds.txt
TS Congress - Reverse Mapped Types TS playgrounds
// identity mapped type
https://www.typescriptlang.org/play?#code/PTAEEsDsAcFcBcBQ8Ce0CmoDyAjAVqALygDeioFoAZgPY0BcoAzvAE5QDmANOZTgIatGkWAFsc6VogC+iRCGqxIAY3jgakZGkwBJACbpIa1AB4AKgD4ipXhQDaAaQiRQAa3QoaVUGYC6jM0dfGTkFZX4AGwitDFAAZX5RTGJ9Q2MUE1w8CyA
// promisify mapped type
https://www.typescriptlang.org/play?#code/C4TwDgpgBA8gRgKygXigbygMwPbYFxQDOwATgJYB2A5gDRRwCGJBFArgLZwQlQC+AUP1CQoABRLZ2ZQmUwgAPABUAfCnT8omqAG0A0lEpQA1hBDZMURQF0CACgCUKVeMnSISvVeX8BQ8NBcpGUwyCAATNUDpWQV4BG9+MIgAYwAbJmhk7ApiKBIwZIIo4NCwwSyc4CxWYFYSaFR85IA6RhIHQUwauohm4AALCApbWwA3BlTHZFU0DS1x1J97IA
// SatisfyName, get access to ur own key in the callback
https://www.typescriptlang.org/play?#code/PTAEDMFcDsGMBcCWB7aAoeBPADgU1AMoCGSAzuJgHJEC2uAPACoB8oAvKAN5qigDaAaVCJooANa5MycKEYBdAFygAFNFq4lAgJTtWAN2SIAJgG40AXzNojuWABsiAJ3xQ4SVKFIlE5TAHkAIwArW3hqOiZmZWRgpWIyCnCGFi0lA2MrLwT-YNCk5U5QEFBkSHhsMp5QIiVVdR02Vm4q3jU6M15zABoqgNq23AamltARgY7QbostEyA
// provideValue, just pairs of data and callbacks that get *their* data as an argument
https://www.typescript

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

@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active June 14, 2024 08:39
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.