Skip to content

Instantly share code, notes, and snippets.

@oleg-smith
oleg-smith / url.go
Created November 12, 2023 00:06
Fetch URL stats
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"net/http"
"net/url"
@oleg-smith
oleg-smith / BlockingQueueIterator.java
Created April 9, 2019 09:45
Streaming xml parsing with xPath
import lombok.SneakyThrows;
import javax.annotation.concurrent.NotThreadSafe;
import java.util.Iterator;
import java.util.concurrent.BlockingQueue;
@NotThreadSafe
public class BlockingQueueIterator<T> implements Iterator<T> {
private final BlockingQueue<QueueEntry<T>> queue;