Skip to content

Instantly share code, notes, and snippets.

package com.levelsbeyond.assetService.jdbi;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.sql.Array;
import java.sql.SQLException;
import java.sql.Types;
@ericdcobb
ericdcobb / pgpool.conf
Last active August 29, 2015 14:08 — forked from jfrost/pgpool.conf
# Watchdog
#------------------------------------------------------------------------------
use_watchdog = on
delegate_IP = '10.10.10.100'
wd_hostname = '10.10.10.21'
wd_port = 9000
ifconfig_path = '/usr/bin'
arping_path = '/usr/bin'
if_up_cmd = 'sudo ip addr add $_IP_$ dev eth0'
if_down_cmd = 'sudo ip addr del $_IP_$ dev eth0'
import java.util.*;
import java.util.concurrent.*;
public class Sample {
public static void main(String[] args) throws Exception {
ExecutorService executorService = Executors.newFixedThreadPool(10);
for(int i = 0; i < 10; i++) {
final int index = i;
executorService.submit(new Runnable() {
@ericdcobb
ericdcobb / threads.java
Created August 22, 2014 15:10
'CachedThreadPool' type behavior with a max number of threads.
package com.levelsbeyond;
import java.util.Date;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* Thread Test
@ericdcobb
ericdcobb / Spike.java
Created July 15, 2014 21:22
An example of a file copy that has progress and the ability to cancel.
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
* Created by ericcobb on 7/15/14.

NEXT

  1. FindDTOService and annotations for looking up DTOs associated with a specific data object.
  • do something
  • do another thing
alias ij='open -a /Applications/IntelliJ\ IDEA\ 13.app/'
alias grun='java org.antlr.v4.runtime.misc.TestRig'
set -x CLASSPATH '.:/usr/local/Cellar/antlr/4.1/antlr-4.1-complete.jar:$CLASSPATH'
set PATH ~/ansiweather/ $PATH
set PATH /usr/include/ $PATH
set -x JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
function fish_prompt
set_color $fish_color_cwd
#include "DHT.h"
#include <LiquidCrystal.h>
#define DHTPIN 2
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
{
"settings": {
"analysis": {
"analyzer": {
"my_ngram_analyzer": {
"tokenizer": "my_ngram_tokenizer",
"filter": [
"lowercase"
],
"type" : "custom"