Skip to content

Instantly share code, notes, and snippets.

View rlespinasse's full-sized avatar

Romain Lespinasse rlespinasse

View GitHub Profile
@rlespinasse
rlespinasse / GoogleAnalytics.java
Last active August 29, 2015 14:06
API design for Dandelion-GUA
GoogleAnalytics.on(request)
// Get (or Create) Default Tracker (with tracking ID from configuration)
.defaultTracker().goBack()
// Get (or Create) Default Tracker
.defaultTracker("UA-XXXX-Y")
.set(GeneralField.anonymizeIp, "true")
.set(SessionField.sessionControl, "sessionControl").goBack()
// Get (or Create) Another Tracker
.tracker("UA-XXXX-Z", "name-Z")
// Access to "create" section
@rlespinasse
rlespinasse / MagicalLand.java
Created February 19, 2013 23:29
Unicorn love Math
public class MagicalLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {