Skip to content

Instantly share code, notes, and snippets.

View tarla's full-sized avatar

João Tarla tarla

  • Huspy
  • Madrid, Spain
  • 05:44 (UTC +02:00)
  • LinkedIn in/joaotarla
View GitHub Profile
@tarla
tarla / Dockerfile
Created July 31, 2016 16:36
default ruby/rails Dockerfile with alpine
FROM ruby:2.3-alpine
MAINTAINER Joao Tarla <[email protected]>
ENV BUILD_PACKAGES="curl-dev ruby-dev build-base bash" \
DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev postgresql-dev" \
RUBY_PACKAGES="ruby-json yaml nodejs"
RUN apk --update add --no-cache --update\
$BUILD_PACKAGES \
$DEV_PACKAGES \
@tarla
tarla / docker-compose.yml
Created July 31, 2016 16:34
default docker-compose with alpine-postgresql
db:
image: kiasaki/alpine-postgres
ports:
- "5432"
web:
build: .
command: bundle exec rails s -p 9000 -b '0.0.0.0'
environment:
BUNDLE_JOBS: 2
PORT: 9000
--colour
--format documentation
--profile
--drb
@tarla
tarla / .gitconfig
Created February 5, 2016 14:56
Git Configuration
[user]
name = $NAME
email = $EMAIL
[alias]
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all --enable=receive-pack ./.git
hist = !git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[push]
default = simple
@tarla
tarla / asyncTestScalaSpecs2.scala
Last active October 8, 2015 01:28
Async Test using Scala Specs 2
...
"awesome test" in new WithApplication {
/* async */
val x = Future { 1 }
x must beEqualTo(1).await
/* xgh */
val y = Await.result(Future { 1 }, 10 seconds)
y must beEqualTo(1) // whitout .async
@tarla
tarla / WeatherDataParser.java
Created September 16, 2015 03:22
Udacity Android JSON Parser
// Udacity's code
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class WeatherDataParser {
/**
* Given a string of the form returned by the api call: