Skip to content

Instantly share code, notes, and snippets.

@drhr
drhr / singletonize_targets.py
Created April 22, 2017 04:06
set IntelliJ CLion "Single instance only" mode on all named build targets
import sys, xml.etree.ElementTree as ET
with open('.idea/workspace.xml', 'r') as f:
data = f.read()
tree = ET.fromstring(data)
configurations = tree.findall('.//configuration[@default="false"][@TARGET_NAME]')
for c in configurations:
@drhr
drhr / BufferDebounceTest.java
Last active October 6, 2016 22:23
A test for "BufferDebounce" to confirm how bursts are captured given particular timings
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.util.List;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.observers.TestSubscriber;