Skip to content

Instantly share code, notes, and snippets.

View EronWright's full-sized avatar

Eron Wright EronWright

View GitHub Profile
@mocobeta
mocobeta / IndexingExample.java
Last active April 28, 2020 02:35
Hello Lucene! (6.0.0)
package example;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.*;
import org.apache.lucene.index.*;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.*;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
apply plugin: 'java'
apply plugin: 'maven-publish'
repositories { jcenter() }
dependencies { compile 'org.slf4j:slf4j-api:1.7.12' }
publishing {
repositories {
maven {
url "http://127.0.0.1:8081/artifactory/libs-release-local/"
@jconwell
jconwell / akkaTestPatterns.md
Last active September 22, 2016 17:13
Unit and functional test patterns for Akka actors in Java

AKKA Test Patterns for Java

NOTE: These patterns assume you have a working understanding of Akka's JavaTestKit

Testing Actors In Complete Isolation

AKKA is all about building hierarchies of actors to represent a system. I've found this is a great way to decompose, design, and if needed distribute a system. This means your system becomes a hierarchy of actors, where parent actors create and manage their child actors, and child actors either carry out some unit of work, and/or themselves become parent actors.

But this can be a bit of a pain when it comes to writing tests for your actors. For example, say we have an actor, actorA, who in turn creates one or more child actors. I could have actorA create its child actor(s) as part of its instantiation. This is attractive especially if I know the exact child actors its going to create.

@guenter
guenter / Main.scala
Last active September 17, 2020 11:25
A simple Mesos "Hello World": downloads and starts a Python web server on every node in the cluster.
import mesosphere.mesos.util.FrameworkInfo
import org.apache.mesos.MesosSchedulerDriver
/**
* @author Tobi Knaup
*/
object Main extends App {
@minrk
minrk / checkipnb.py
Last active April 9, 2022 16:51
run and validate a notebook
#!/usr/bin/env python
"""
simple example script for running notebooks and reporting exceptions.
Usage: `checkipnb.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and checked for errors.
"""
import os,sys,time
@timo
timo / notebook_launcher.py
Created December 19, 2011 16:26
branded ipython notebook launcher
"""==============================
Branded IPython Notebook Launcher
=================================
Executing this module will create an overlay over ipython notebooks own static
files and templates and overrides static files and templates and copies over all
example notebooks into a temporary folder and launches the ipython notebook server.
You can use this to offer an interactive tutorial for your library/framework/...