Skip to content

Instantly share code, notes, and snippets.

View lucianenache's full-sized avatar
💭
λ

Lucian E. lucianenache

💭
λ
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lucianenache on github.
  • I am lucian_enache (https://keybase.io/lucian_enache) on keybase.
  • I have a public key whose fingerprint is E349 CC65 D191 930C D888 F808 CCAD 6783 8C82 C1EB

To claim this, I am signing this object:

@lucianenache
lucianenache / Scala_constructs.scala
Last active February 9, 2016 20:46
Scala constructs document for resolving futures, options, and other monadic types
//////////////////////////////////////////// Option ////////////////////////////////////////////////////////////////////////
obj.fold(defaultVal)(func)
obj.map(func).getOrElse(defaultVal)
obj match {
case Some(x) => func(x);
case None => defaultVal
}
// composed Option[A]
val oa: Option[String] = Some("a")

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@lucianenache
lucianenache / java-8-ami.md
Created January 27, 2016 09:00 — forked from rtfpessoa/java-8-ami.md
[Guide] Install Sun Java 8 on Amazon EC2 Ami

First verify the version of Java being used is not Sun Java 8 SDK

java -version

Get the Sun Java 8 SDK from Oracle

wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm"

Install Sun Java 8

sudo rpm -i jdk-8u11-linux-x64.rpm

Check if the default java version is set to Sun Java 8 SDK