Skip to content

Instantly share code, notes, and snippets.

View den-kozlov's full-sized avatar

Denis Kozlov den-kozlov

  • Saint-Petersburg, Russia
View GitHub Profile
local client = require 'http.client'
local fiber = require 'fiber'
local yaml = require 'yaml'
local uris = {
'http://httpbin.org/get?1',
'http://httpbin.org/get?2',
'http://httpbin.org/get?3',
'http://httpbin.org/get?4',
'http://httpbin.org/get?5',
@wjordan
wjordan / dockerize.sh
Last active June 22, 2020 15:47
Dockerize: A tiny replacement for Dockerfiles
#!/bin/sh
####
# Dockerize: A tiny replacement for Dockerfiles
# This script leverages `docker run` and `docker commit` to provide a usable workaround for
# restrictions of `docker build` and Dockerfile syntax to strictly host-independent builds.
#
# See these discussions:
# https://github.com/docker/docker/pull/1124
# https://github.com/docker/docker/issues/3156
# https://github.com/docker/docker/issues/3949
@agaricusb
agaricusb / gist:4575843
Created January 19, 2013 23:42
fernflower 0.8.6 cA NPE patch (fix for missing classes)
--- a/cA.java
+++ b/cA.java
@@ -234,7 +234,7 @@ public final class cA {
private aJ a(aK var1, cX var2, aG var3) {
aK var5 = (aK)aD.f().a().get(var3.g());
String var4 = cP.a(var3.k(), var3.h());
- if(var5.h.containsKey(var4) && (var4 = (String)var5.i.get(var4)) != null && var4.length() > 0) {
+ if(var5 != null && var5.h != null && var5.h.containsKey(var4) && (var4 = (String)var5.i.get(var4)) != null && var4.length() > 0) {
if(!a(var1, var5)) {
return null;
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
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

@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of