Skip to content

Instantly share code, notes, and snippets.

View agibalov's full-sized avatar

Andrey Agibalov agibalov

  • NJ
View GitHub Profile
@jboner
jboner / latency.txt
Last active May 21, 2026 10:34
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
@briancavalier
briancavalier / 1-instructions.md
Created August 8, 2012 21:05
Hello wired for wire.js in node

Hello wire in node.js

  1. mkdir hello-wire
  2. cd hello-wire
  3. npm install wire
  4. Create main.js and spec.js as per the files in this gist.
  5. node main.js
@edwardbeckett
edwardbeckett / build.gradle
Created April 13, 2013 06:59
mysema.querydsl gradle
sourceSets {
generated {
java {
srcDirs = ['src/main/generated']
}
}
}
configurations {
querydslapt
@balupton
balupton / README.md
Last active June 7, 2021 16:00
Node.js Best Practice Exception Handling
public static void runServer() {
try {
MulticastSocket s = new MulticastSocket(4446);
InetAddress group = InetAddress.getByName("224.0.0.10");
s.joinGroup(group);
byte[] data = new byte[100];
DatagramPacket datagramPacket = new DatagramPacket(data, data.length);
s.receive(datagramPacket);
Log.i("Received: " + data);
return;
@chibat
chibat / gist:8004877
Last active December 31, 2015 15:09
Spring boot with h2 console
package hello;
import javax.sql.DataSource;
import jp.sf.amateras.mirage.SqlManager;
import jp.sf.amateras.mirage.SqlManagerImpl;
import jp.sf.amateras.mirage.dialect.HyperSQLDialect;
import jp.sf.amateras.mirage.integration.spring.SpringConnectionProvider;
import org.apache.commons.dbcp.BasicDataSource;
@mdaniel
mdaniel / logging_mdc.py
Created January 10, 2014 05:47
Just like the docstring says: Demonstrates how a [Mapped Diagnostic Context](http://logback.qos.ch/manual/mdc.html) of log4j MDC fame (and also provided in slf4j) could be implemented in Python
# coding=utf-8
"""
Demonstrates how a [Mapped Diagnostic Context](http://logback.qos.ch/manual/mdc.html)
of log4j MDC fame (and also provided in slf4j) could be implemented in Python
"""
import json
import logging
import sys
import threading