Skip to content

Instantly share code, notes, and snippets.

View letnotimitateothers's full-sized avatar

Amélie Medem letnotimitateothers

View GitHub Profile

Error Handling in Scala

Scala does not have checked exceptions like Java, so you can't do soemthing like this to force a programmer to deal with an exception:

public void stringToInt(String str) throws NumberFormatException {
  Integer.parseInt(str)
}
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/test
curl -X PUT localhost:9200/test -d '
{
"settings" : {
"index" : {
"analysis" : {
@letnotimitateothers
letnotimitateothers / README.md
Created October 23, 2016 18:19 — forked from davemo/README.md
A simple Backbone.js powered Slideshow, with pause/play controls and jump-to controls.

#A simple Slideshow module wrapped in a Backbone View

  • Dependencies ** underscore.js ** backbone.js

Viewable in action in this jsfiddle

@letnotimitateothers
letnotimitateothers / Geocode.java
Created July 19, 2016 10:47 — forked from rkaneko/Geocode.java
The Snippet to call Google Geocode API on Play framework(v2.1.0) .
import org.codehaus.jackson.JsonNode;
import play.libs.WS;
import play.libs.F.Promise;
import play.libs.WS.WSRequestHolder;
/**
* Refer
* http://goo.gl/HXhJG
* Javadoc api/2.1.0/java/play/libs/WS.WSRequestHolder : http://goo.gl/AXmBY
@letnotimitateothers
letnotimitateothers / Application.java
Last active September 13, 2015 14:29 — forked from steren/Application.java
Upload and store image with Play! Framework
public class Application extends Controller {
public static void index() {
render();
}
public static void uploadPicture(Picture picture) {
picture.save();
index();
}
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person