Skip to content

Instantly share code, notes, and snippets.

View aboisvert's full-sized avatar

Alex Boisvert aboisvert

View GitHub Profile
@aboisvert
aboisvert / proguard.rb
Created April 5, 2013 22:25
Proguard plugin for Apache Buildr
#
# Usage:
#
# Add the following at the top of your buildfile,
#
# require 'proguard.rb'
#
# And specify your proguard jar in your project,
#
# package(:proguard).tap do |proguard|
@aboisvert
aboisvert / supersonic.log
Created October 19, 2012 19:14
supersonic ./configure failing
Starting supersonic VERSION=-1-dev STAGE=dev CUSTOM_PARAMS=""
+/mnt/bizo/supersonic/bin/cowboy-init.sh:3:: cd /mnt/bizo/supersonic
+/mnt/bizo/supersonic/bin/cowboy-init.sh:4:: rm -rf supersonic-all
+/mnt/bizo/supersonic/bin/cowboy-init.sh:5:: mkdir supersonic-all
+/mnt/bizo/supersonic/bin/cowboy-init.sh:6:: cd supersonic-all
+/mnt/bizo/supersonic/bin/cowboy-init.sh:7:: git clone https://code.google.com/p/supersonic/
Cloning into 'supersonic'...
+/mnt/bizo/supersonic/bin/cowboy-init.sh:10:: wget https://google-glog.googlecode.com/files/glog-0.3.2.tar.gz
--2012-10-19 18:32:33-- https://google-glog.googlecode.com/files/glog-0.3.2.tar.gz
Resolving google-glog.googlecode.com (google-glog.googlecode.com)... 173.194.75.82, 2607:f8b0:400c:c01::52
public class Foo {
int foo = 1;
}
VERSION_NUMBER = "1.0.0"
GROUP = "buildr-junit"
repositories.remote << "http://www.ibiblio.org/maven2/"
define "buildr-junit" do
project.version = VERSION_NUMBER
project.group = GROUP
#test.using :junit
package(:jar)
@aboisvert
aboisvert / buildfile
Created July 27, 2012 16:00
Buildr FlatSpec Example
require 'buildr/scala'
VERSION_NUMBER = "1.0.0"
repositories.remote << "http://repo1.maven.org/maven2"
repositories.remote << "http://oss.sonatype.org/content/repositories/releases""
define "buildr-flatspec" do
project.version = VERSION_NUMBER
project.group = "org.example"
@aboisvert
aboisvert / gist:1953933
Created March 1, 2012 23:13
git update-index --assume-unchanged
git update-index --assume-unchanged .classpath
You can now diff/pull/rebase/etc. and git-svn will completely ignore any
local changes in your .classpath file, without having to constantly
stash/unstash. Unless there are conflicts.
@aboisvert
aboisvert / scala_cl.rb
Created December 1, 2011 18:34
Buidlr plugin for the ScalaCL plugin
#
# Buildr plugin to compile Scala code with the ScalaCL plugin.
# http://code.google.com/p/scalacl/wiki/ScalaCLPlugin
#
# To use,
# 1) add "require 'scala_cl'" to your buildfile
# 2) add "extend Buildr::ScalaCL" to your project definition
#
# Copyright (C) 2011 by Alex Boisvert
#
@aboisvert
aboisvert / buildfile
Created November 11, 2011 23:18
Apache Buildr "buildfile" for Scalatra project
require 'extensions/kernel' if RUBY_VERSION =~ /1.8/
require 'buildr/scala'
require_relative 'explode'
load 'scalatra.rb'
VERSION_NUMBER = "2.1.0-SNAPSHOT"
repositories.remote << "http://www.ibiblio.org/maven2/"
@aboisvert
aboisvert / monkey_patch_mapper.rb
Created September 27, 2011 17:54
Monkey patching Buildr's Mapper class to avoid resource filtering of binary file s
module Buildr
class Filter
class Mapper
alias_method :transform_old, :transform
BINARY_FILES = [ '*.png', '*.gif' ]
def is_binary?(content, path)
BINARY_FILES.any? { |glob| File.fnmatch(glob, path) }
@aboisvert
aboisvert / union.scala
Created June 9, 2011 18:06
Union Type + Specialized
object Union {
type ¬[A] = A => Nothing
type ¬¬[A] = ¬[¬[A]]
type ∨[T, U] = ¬[¬[T] with ¬[U]]
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) }
def size[@specialized(Int) T : (Int |∨| String)#λ](t : T) = t match {
case i : Int => i
case s : String => s.length
}