Skip to content

Instantly share code, notes, and snippets.

View aaronhanson's full-sized avatar

Aaron Hanson aaronhanson

View GitHub Profile
@aaronhanson
aaronhanson / grayduck.vim
Last active March 7, 2017 23:49
grayduck vim colorscheme
set bg=dark
hi clear
" Load the syntax highlighting defaults, if it's enabled.
if exists("syntax_on")
syntax reset
endif
let colors_name = "grayduck"
@aaronhanson
aaronhanson / timed_producer.py
Last active December 8, 2016 22:26
Timed Kafka Producer
#!/usr/bin/env python
from kafka import KafkaProducer
import argparse
import os
import time
class TimedProducer():
def __init__(self, *args, **kwargs):
self.topic = kwargs.get('topic')
@aaronhanson
aaronhanson / timed_consumer.py
Last active December 8, 2016 22:25
Timed Kafka Consumer
#!/usr/bin/env python
from kafka import KafkaConsumer
import os
import sys
import time
import argparse
class TimedConsumer():
def __init__(self, *args, **kwargs):
@aaronhanson
aaronhanson / 2016-opi-lightning-talk-links.txt
Last active October 24, 2016 22:54
2016 - OPI Lightning talk
@aaronhanson
aaronhanson / SftpServer.groovy
Created December 31, 2014 15:56
Simple Groovy Sftp Server
@Grab(group='org.apache.sshd', module='sshd-core', version='0.13.0')
import org.apache.sshd.SshServer
import org.apache.sshd.server.PasswordAuthenticator
import org.apache.sshd.server.command.ScpCommandFactory
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
import org.apache.sshd.server.session.ServerSession
import org.apache.sshd.server.sftp.SftpSubsystem
import org.apache.sshd.server.shell.ProcessShellFactory
@aaronhanson
aaronhanson / defaulted-params.groovy
Last active December 17, 2015 14:19
Stumbled onto similar code to this and had to double check what it did.
def foo(p1, p2=2, p3) {
println "$p1, $p2, $p3"
}
foo(10, 20)
// 10, 2, 20
@aaronhanson
aaronhanson / 9_Crimes_in_Orkney
Last active December 15, 2015 23:49
Damien Rice - 9 Crimes (Orkney Tuning)
Title: 9 Crimes
Artist: Damien Rice
Intro
D|---------------------|---------------------|---------------------|---------------------|
C|---------------------|---------------------|---------------------|---------------------|
G|-----------2----4----|-5-------------------|---------------------|-----------0----2----|
D|------2--------------|-----------3----5----|-----------0----2----|------0--------------|
G|-2-------------------|------5--------------|------0--------------|-0-------------------|
@aaronhanson
aaronhanson / index.html
Created November 24, 2015 18:06
Sample Index Page
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Spring Pac4j Demo</title>
</head>
<body>
<h2>Index Page</h2>
</body>
</html>
import kafka.server.KafkaConfig;
import kafka.server.KafkaServer;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
@aaronhanson
aaronhanson / sample.md
Created November 6, 2014 17:15
Sample Markdown Blog Post

Heading 1

Heading 2

  • list element 1
  • list element 2
  • list element 3

Plain old paragraph text. What would be the main body of the article.