Skip to content

Instantly share code, notes, and snippets.

View darekmydlarz's full-sized avatar
👨‍💻
Senior Software Engineer

Dariusz Mydlarz darekmydlarz

👨‍💻
Senior Software Engineer
View GitHub Profile
@darekmydlarz
darekmydlarz / server.py
Created September 21, 2017 12:48 — forked from raelmax/server.py
Python SimpleHTTPServer com sleep
import SimpleHTTPServer
import SocketServer
from time import sleep
PORT = 5000
SLEEP_TIME = 6
class SlowHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
@darekmydlarz
darekmydlarz / introrx.md
Created December 12, 2016 10:00 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@darekmydlarz
darekmydlarz / latency.markdown
Created November 10, 2016 12:55 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@darekmydlarz
darekmydlarz / build.gradle
Created March 24, 2016 12:42 — forked from ysb33r/build.gradle
HOWTO ignore spock tests when gradle is run offline
// Check whether --offline was passed to gradle and set it in the test configuration's system properties
test {
if(gradle.startParameter.isOffline()) {
systemProperties 'TESTS.ARE.OFFLINE' : '1'
}
}
@darekmydlarz
darekmydlarz / es_pri_allocate_unassigned.md
Created March 24, 2016 08:08 — forked from ianblenke/es_pri_allocate_unassigned.md
elasticsearch trying to allocate a primary shard which is disabled

Allow routing allocations:

curl -XPUT localhost:9200/_cluster/settings -d '{
                "transient" : {
                    "cluster.routing.allocation.enable" : "all"
                }
        }'
@darekmydlarz
darekmydlarz / telnet-imap
Created October 20, 2015 13:10 — forked from gustavohenrique/telnet-imap
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login user@gmail.com passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@darekmydlarz
darekmydlarz / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console