Skip to content

Instantly share code, notes, and snippets.

@dehora
dehora / debug_logging_ddb_local.sh
Last active March 18, 2023 17:42
debug logging for dynamodb local
cd ~/projects/bin/dynamodb
cat > log4j2.xml <<- XML
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="fatal">
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
@dehora
dehora / readme.md
Last active June 28, 2022 22:26
Setting up Python and pyenv on Monterey // 2022-06-28

Upgrade xcode cli tools to the most recent (this takes a while):

$ softwareupdate --list
$ softwareupdate --install "Command Line Tools for Xcode-13.4"

Watch pyenv not be able to install anything (pyenv/issues/2143), because of what seems to be a mismatch across Python, Clang and Monterey (issue45405).

Update pyenv to pick up patched versions that work (3.10.3+, 3.9.13, 3.9.9, 3.8.13, 3.7.13).

@dehora
dehora / swim.md
Last active January 8, 2021 03:33
SWIM protocol resources
@Override
public SubscriptionList loadSubscriptions(String id) {
final Set<String> keys = jedisProvider.get().smembers(createSubscriptionsKey(id));
final List<Subscription> subs = keys.stream().map(this::getSubscription).collect(Collectors.toList());
return new SubscriptionList(subs);
}
@dehora
dehora / HeilmeierQuestions.md
Created August 16, 2016 12:01
Heilmeier Questions

HeilmeierQuestions

  • What are you trying to do? No jargon. What is the problem? Why is it hard?

  • How is it done today, and what are the limits of current practice?

  • What's new in your approach and why do you think it will be successful?

  • Who cares?

@dehora
dehora / gradle-executable-jar.md
Last active October 3, 2018 15:09
Executable fat jars via gradle

Executable fat jars are easy to deploy and upgrade, and don't need wrapper scripts to pull in the classpath. You can use the Gradle fatjar plugin to create executable, self-contained jars in Gradle, akin to the Shade plugin for Maven -

apply plugin: 'fatjar'
buildscript {
  dependencies {
  classpath 'eu.appsatori:gradle-fatjar-plugin:0.1.3'  
  }
}

Keybase proof

I hereby claim:

  • I am dehora on github.
  • I am dehora (https://keybase.io/dehora) on keybase.
  • I have a public key ASCMcCHXvRlJKpB5ioCcRqJBvT0NT2XNZh4VR8JnJCnf0Qo

To claim this, I am signing this object:

package services
import java.security.Security
import org.slf4j.LoggerFactory
object DnsCache {
private val logger = LoggerFactory.getLogger("DnsCache")
@dehora
dehora / pydev_ipython_console_011.py
Created April 9, 2018 18:35
fix pycharm console start crash with anaconda
subl /Users/bdehora/Library/Application\ Support/JetBrains/Toolbox/apps/PyCharm-P/ch-1/181.4445.28/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py
class PyDevIPCompleter(IPCompleter):
def __init__(self, *args, **kwargs):
""" Create a Completer that reuses the advanced completion support of PyDev
in addition to the completion support provided by IPython """
IPCompleter.__init__(self, *args, **kwargs)
# Use PyDev for python matches, see getCompletions below
@dehora
dehora / StreamsMain.java
Created November 11, 2016 14:48
Example Streams
package spike;
import java.util.concurrent.TimeUnit;
import nakadi.Cursor;
import nakadi.LoggingStreamObserverProvider;
import nakadi.LoggingStreamOffsetObserver;
import nakadi.NakadiClient;
import nakadi.Response;
import nakadi.StreamConfiguration;
import nakadi.StreamProcessor;