Skip to content

Instantly share code, notes, and snippets.

View alcarvalho's full-sized avatar

Andre Carvalho alcarvalho

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alcarvalho on github.
  • I am alcarvalho (https://keybase.io/alcarvalho) on keybase.
  • I have a public key whose fingerprint is 4D63 A6BB 37F7 BD24 F5A9 FB5C D7D7 C8B7 0017 26CB

To claim this, I am signing this object:

[color]
ui = true
[core]
ignorecase = false
autocrlf = input
[alias]
# Fancy logging.
# h = head
# hp = head with patch
# r = recent commits, only current branch
#!/bin/sh
# Author: Nikita Kovalev, https://gist.github.com/maizy/c4d31c1f539694f721f6
# Based on: https://gist.github.com/visenger/5496675
# Use java7 dependency (openjdk) instead of java6.
# Tested in
# - Ubuntu 12.04.5 (precise)
# - Ubuntu 14.04 (64 bit)
@alcarvalho
alcarvalho / intellij_gradle_java8.sh
Last active May 3, 2016 16:28
Script to set gradle's jvm to Java 8 inside IntelliJ installations on Mac OS X.
#!/bin/bash
# You can run it by copying and pasting the following on your terminal:
# curl "https://gist.githubusercontent.com/alcarvalho/26fb041de96f6cf30e91/raw/intellij_gradle_java8.sh" | bash
function die() {
echo $1
exit 1
}
function get_java8_home() {
@alcarvalho
alcarvalho / Boot.scala
Created August 21, 2014 19:21
Lift rewrite rules and SiteMap
LiftRules.statelessRewrite.prepend(NamedPF("Portal Rewrite") {
case RewriteRequest(
ParsePath(portal :: Nil, _, true, _), _, _
) => RewriteResponse("portal" :: portal :: Nil, stopRewriting = true)
case RewriteRequest(
ParsePath(portal :: "index" :: Nil, _, true, true), _, _
) => RewriteResponse("portal" :: portal :: Nil, stopRewriting = true)
})
val portalMenu = Menu.param[Portal](
@alcarvalho
alcarvalho / Procfile
Created February 3, 2014 13:04
These are the files you need to modify to deploy your Finatra project to Heroku.
web: target/start -com.twitter.finatra.config.env=production -com.twitter.finatra.config.adminPort='' -com.twitter.finatra.config.port=":$PORT"
@alcarvalho
alcarvalho / BetamaxHelper.scala
Created January 20, 2014 19:28
Betamax 2.0-SNAPSHOT testing with ScalaTest. This is based on https://gist.github.com/mrpotes/6029082.
import co.freeside.betamax.{ProxyConfiguration, TapeMode, Recorder}
import com.google.common.base.Optional
import java.io.File
trait Wrapped {
implicit def wrapPartialFunction(f: (=> Unit) => Unit) = new wrapped(f)
class wrapped(f: (=> Unit) => Unit) {
def using(f1: => Unit) = f {
f1
@alcarvalho
alcarvalho / gist:6926457
Created October 10, 2013 22:13
GHC build failure
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install darinmorrison/haskell/cabal-install
Warning: Your Xcode (5.0) is outdated
Please install Xcode 5.0.1.
==> Installing dependencies for cabal-install: ghc
==> Installing cabal-install dependency: ghc
==> Downloading http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-src.tar.bz2
Already downloaded: /Library/Caches/Homebrew/ghc-7.6.3.tar.bz2
tar xf /Library/Caches/Homebrew/ghc-7.6.3.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff