Skip to content

Instantly share code, notes, and snippets.

View frozenspider's full-sized avatar

Alex Abdugafarov frozenspider

View GitHub Profile
@frozenspider
frozenspider / gist:9376005
Last active August 29, 2015 13:57
Different formats of one-liners
// Ugly one-liner: type is in the middle of the line, implementation takes less than half a line
// Pain!
implicit class RichSsWorkbook(wb: Workbook) {
def apply(i: Int): Sheet = wb.getSheetAt(i)
def bytes: Array[Byte] = {
val baos = new ByteArrayOutputStream
wb.write(baos)
baos.toByteArray
}
@frozenspider
frozenspider / gist:9135498
Created February 21, 2014 14:46
class ProposalMapping
/**
* Entity representing mapping of comp proposal from XLS column names.
*
* @author FS
*/
// Please preserve attribute order when defining a new mapping
class ProposalMapping(
// Date
val executionDate: Option[String],
val commencementDate: Option[String],
@frozenspider
frozenspider / gist:9069233
Last active August 29, 2015 13:56
ProposalMapping definition options
new ProposalMapping(
executionDate = None,
commencementDate = None,
expirationDate = None,
freeMonths = None,
leaseTerm = None
)
new ProposalMapping(