Skip to content

Instantly share code, notes, and snippets.

Brad Koehn koehn

  • Koehn Consulting, Inc.
Block or report user

Report or block koehn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@koehn
koehn / cleanup.sh
Created Jul 1, 2016
Clean up dangling docker volumes
View cleanup.sh
docker volume ls -qf dangling=true | xargs -r docker volume rm
@koehn
koehn / txt
Created Mar 7, 2016
Fix Mac Docker
View txt
Run the Docker Quickstart Terminal app
Run docker-machine restart default
Run eval $(docker-machine env default)
@koehn
koehn / diaspora-init
Created Dec 16, 2015
Required for my `/etc/init.d/diaspora` init script. Put this into `/home/diaspora/diaspora/diaspora-init`.
View diaspora-init
#!/bin/bash --login
shopt -s expand_aliases
export RAILS_ENV=production
export DB=postgres
cd /home/diaspora/diaspora
./script/server
@koehn
koehn / diaspora
Last active Aug 14, 2016
Init file to start/stop Diaspora. Requires a file in /home/diaspora/diaspora/diaspora-init (see my gists for more). Hit me up on diaspora at bkoehn@diaspora.koehn.com if you have any questions.
View diaspora
#! /bin/sh
### BEGIN INIT INFO
# Provides: diaspora
# Required-Start: apache2
# Required-Stop:
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Diaspora social networking pod server
@koehn
koehn / java2groovy.vim
Last active Aug 29, 2015
These VIM macros help to covert Java to Groovy. Sadly neither IntelliJ nor Eclipse has regex that can handle this, but VIM is always available.
View java2groovy.vim
# no semicolons at eol
:%s/;[ \t]*$//
# no 'public'
:%s/public //
# convert Java 'bar.getFoo()' to Groovy 'bar.foo' in VIM
:%s/\.\(get\|is\)\(\u\)\(\w\+\)()/.\l\2\3/g
# convert Java 'foo.setBar(baz)' to Groovy 'foo.bar = baz'
@koehn
koehn / welcome.md
Created May 30, 2014
My standard welcome message.
View welcome.md

Welcome to the pod! Be sure to check out the tutorials and wiki to learn how diaspora works.

Enjoy!

@koehn
koehn / configure-dovecot.sh
Created May 14, 2014
Configure dovecot 2.x build
View configure-dovecot.sh
./configure --with-pam --with-solr --with-sql --with-mysql --with-zlib --with-bzlib
@koehn
koehn / GenericsQuiz.java
Last active Jan 3, 2016
Test your Java generics knowledge with this pop quiz: which are the valid statements?
View GenericsQuiz.java
import java.util.List;
public class GenericsQuiz {
List<Number> listOfNumber;
List<? extends Number> listOfExtendsNumber;
List<? super Number> listOfSuperNumber;
List<Integer> listOfInteger;
List<? extends Integer> listOfExtendsInteger;
List<? super Integer> listOfSuperInteger;
@koehn
koehn / quit.sh
Created Jan 4, 2014
A simple command-line utility to use AppleScript (neé OSAScript) to quit an application. Usage: `quit [Application Name]`
View quit.sh
#!/bin/bash
osascript -e "tell application \"$1\" to quit"
You can’t perform that action at this time.