This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function boot-tmux { | |
echo -ne "\033]0;$@\007" | |
tmux new-session -d -s $@ | |
tmux send-keys -t $@ "teamocil --here $@" C-m | |
tmux attach-session -t $@ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fizzbuzz.core) | |
(defn multiple? [x n] | |
(= 0 (mod x n))) | |
(defn fizzbuzz [number] | |
(if (multiple? number 3) | |
(if (multiple? number 5) (prn "FizzBuzz") (prn "Fizz")) | |
(if (multiple? number 5) (prn "Buzz") (prn number)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyLookupServiceImpl implements ApplicationContextAware { | |
private com.maxmind.geoip.LookupService lookupService; | |
private String dataPath; // classpath location of .dat file, e.g GeoIPCity.dat | |
private ApplicationContext context; | |
// constructor that allows us to inject a LookupService, e.g. for testing | |
public MyLookupServiceImpl(com.maxmind.geoip.LookupService lookupService) { | |
this.lookupService = lookupService; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<properties> | |
<geocity.version>2011-10-25</geocity.version> | |
</properties> | |
... | |
<dependency> | |
<groupId>com.maxmind</groupId> | |
<artifactId>geocity</artifactId> | |
<version>${geocity.version}</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# thor maxmind --version=VERSION --repositoryUrl=URL --repositoryId=ID [--temp=/tmp] | |
class Maxmind < Thor | |
include Thor::Actions | |
class_options :version => :string, | |
:repositoryUrl => :string, | |
:repositoryId => :string, | |
:temp => File.join(ENV["HOME"], "Downloads") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(n: Int) = (i: Int) => n + i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g prefix C-a | |
bind-key C-a last-window | |
# Get scrolling in pane to work | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# Set up horizontal and vertical splitting | |
unbind % | |
bind \ split-window -h | |
bind - split-window -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS_JAVA_SDK_BUILD_TOOLS = ["com.amazonaws:aws-java-sdk:jar:1.3.10", | |
"com.amazonaws:aws-java-sdk-flow-build-tools:jar:1.3.10"] | |
# The following is assumed to be embedded inside a project definition, otherwise | |
# you will need to pass the project to the task. | |
... | |
# Task for Generating Sources via Java APT, note this overwrites any current source | |
task :apt do | |
rm_rf project.path_to(:src, :generated, :java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Precompiler | |
include Extension | |
first_time do | |
# Define task not specific to any projet. | |
desc 'Precompile jsps' | |
Project.local_task('precompile' => 'compile') { |name| "Precompiling #{name}" } | |
end | |
before_define do |project| |
NewerOlder