Skip to content

Instantly share code, notes, and snippets.

@dinvlad
dinvlad / gist:83c078481649a35e16d9112d2743dab9
Last active July 28, 2019 07:40 — forked from mackstann/gist:4229933
Gigantic recursive directory entry counter
// http://www.olark.com/spw/2011/08/you-can-list-a-directory-with-8-million-files-but-not-with-ls/
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
@dinvlad
dinvlad / PubSubServiceExcerpt.java
Last active September 18, 2018 14:11
Workaround for listening on PubSub subscriptions even when StreamingPull stops silently
// ... other dependencies ...
import com.google.api.core.ApiService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.cloud.pubsub.v1.MessageReceiver;
import com.google.cloud.pubsub.v1.Subscriber;
import com.google.pubsub.v1.Subscription;
import org.springframework.stereotype.Service;