Skip to content

Instantly share code, notes, and snippets.

@keke1123
keke1123 / ElasticsearchJavaExample
Last active April 9, 2023 08:37
Elasticsearch for Java API Simple Example
/**
* Elasticsearch Java API Example
*/
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
import org.elasticsearch.action.admin.indices.mapping.delete.DeleteMappingResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
@keke1123
keke1123 / FormBinder.js
Created November 24, 2015 02:39
Simple jQuery data form binder script
function print(msg) {
if (console.log) {
console.log(msg);
return;
}
alert(msg);
}
var FormBinder = function (id, submitFunction) {
if (!jQuery) {
print('jQuery not loaded');