Skip to content

Instantly share code, notes, and snippets.

View kevindenight's full-sized avatar
👨‍💻
Reading codes

Kevin Denight kevindenight

👨‍💻
Reading codes
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
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
@onexdrk
onexdrk / gist:603013194e8b1ee5043a
Created November 23, 2014 23:47
install protobuf 2.3.0 on mac os (10.10 in my case)
To install protobuf 2.3.0 in mac os (10.10) you need to do folowing:
install mac os developer tools
download and extract protobuf 2.3.0 : https://code.google.com/p/protobuf/downloads/list
open src/google/protobuf/message.h
and change lines to (see https://code.google.com/p/protobuf/issues/detail?id=570 and http://alfredgamulo.com/problem-installing-protobuf-2-3-0-on-mac/ if you want)
#ifdef __DECCXX
// HP C++'s iosfwd doesn't work.
@dedlim
dedlim / claude_3.5_sonnet_artifacts.xml
Last active July 26, 2024 07:55
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times