Skip to content

Instantly share code, notes, and snippets.

View alternegro's full-sized avatar

Altern Egro alternegro

View GitHub Profile
package com.alternegro
import java.util.Date
import java.util.Calendar
import java.util.GregorianCalendar
import scala.xml._
import scala.collection.JavaConversions._
object MoviesParser extends App {
case class CastMember(role: String, firstName: String, lastName: String)
case class Movie(title: String, description: String, rating: String, cast:List[CastMember]=Nil)
@alternegro
alternegro / gist:4568362
Created January 18, 2013 20:43
play scala soap client plus json transformation
def interday(symbol:String, range:String) = Action {request =>
Async {
WS.url("http://api.sproutwerks.com/api/TimeSeries/TimeSeries.svc").withHeaders(CONTENT_TYPE -> "application/soap+xml").post(ChartRequests.interdayRequest(symbol, range)).map { response =>
Ok(timeSeriesToJson(range.toUpperCase, response.xml, noFilter, timeLabeler(range))).as(JSON)
}
}
}
def intraday(symbol:String) = Action {request =>
Async {
@alternegro
alternegro / gist:3007373
Created June 27, 2012 22:43
Xcode Shortcuts

Xcode Shortcuts

Running

⌘R Run
⌘U Unit Test
⌘I Instruments Profile
⇧⌘B Analyze

Navigation

@alternegro
alternegro / gist:2986562
Created June 25, 2012 04:39 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@alternegro
alternegro / play.conf
Created June 1, 2012 20:56 — forked from leon/play.conf
Upstart script for Play Framework 2.0
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/play.conf
#
# This could be the foundation for pushing play apps to the server using something like git-deploy
# By calling service play stop in the restart command and play-start in the restart command.
#
# Usage:
# start play
# stop play
# restart play
@alternegro
alternegro / url_to_jpg.rb
Created April 25, 2012 19:07 — forked from mattetti/url_to_jpg.rb
MacRuby script to grab an url and save it as a jpg
#!/usr/local/bin/macruby
# Copyright (c) 2009 Matt Aimonetti
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: