This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> | |
<title>a little bit of js</title> | |
<script type="text/javascript"> | |
var de = {}; // so erzeugt man ein Objekt... | |
de.lefloh = {}; // ... und baut sich seinen Scope | |
de.lefloh.Core = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:mongo_dart/mongo_dart.dart'; | |
class MongoTest { | |
Db _db = new Db('mongodb://localhost/test'); | |
insert() { | |
_db.open().then((_) { | |
return _db.collection('foo').insertAll([{ 'foo': 'bar' }]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<dartKeyBindings version="1"> | |
<keyBinding commandName="Activate Editor" context="org.eclipse.ui.contexts.window" keySequence="COMMAND+F12" /> | |
<keyBinding commandName="Backward History" context="org.eclipse.ui.contexts.window" keySequence="ALT+COMMAND+ARROW_LEFT" /> | |
<keyBinding commandName="Close" context="org.eclipse.ui.contexts.window" keySequence="COMMAND+W"/> | |
<keyBinding commandName="Close All" context="org.eclipse.ui.contexts.window" keySequence="COMMAND+SHIFT+W"/> | |
<keyBinding commandName="Close Glance" context="com.xored.glance.ui.context" keySequence="ESC"/> | |
<keyBinding commandName="Content Assist" context="org.eclipse.ui.contexts.dialogAndWindow" keySequence="CTRL+SPACE"/> | |
<keyBinding commandName="Copy" context="org.eclipse.ui.contexts.dialogAndWindow" keySequence="COMMAND+C"/> | |
<keyBinding commandName="Copy Lines" context="org.eclipse.ui.textEditorScope" keySequence="ALT+COMMAND+ARROW_DOWN"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create two indexes | |
curl -XPUT 'http://docker:9200/idx-1/user/1' -d '{ | |
"name" : "John Doe" | |
}' | |
curl -XPUT 'http://docker:9200/idx-2/user/1' -d '{ | |
"name" : "Jane Doe" | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebTarget target = client.target("/some-resource"); | |
MultipartFormDataOutput formData = new MultipartFormDataOutput(); | |
formData.addFormData("file", fileContent, MediaType.TEXT_PLAIN_TYPE.withCharset("utf-8")); | |
Entity<MultipartFormDataOutput> entity = Entity.entity(formData, MediaType.MULTIPART_FORM_DATA); | |
Response response = target.request().post(entity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Provider | |
public class CharsetFilter implements ContainerRequestFilter { | |
@Override | |
public void filter(ContainerRequestContext requestContext) throws IOException { | |
String charset = requestContext.getHeaderString("X-Charset"); | |
if (charset != null) { | |
requestContext.setProperty(InputPart.DEFAULT_CHARSET_PROPERTY, charset); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@POST | |
@Path("/form") | |
@Consumes(MediaType.MULTIPART_FORM_DATA) | |
@Produces(MediaType.TEXT_PLAIN) | |
public Response uploadForm(MultipartFormDataInput input) throws IOException { | |
String charset = input.getFormDataMap().get("_charset_").get(0).getBodyAsString(); | |
InputPart file = input.getFormDataMap().get("file").get(0); | |
InputStream inputStream = file.getBody(InputStream.class, null); | |
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, charset)); | |
String line; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /some-resource HTTP/1.1 | |
Content-Type: text/plain; charset=utf-8 | |
füübär |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /some-resource HTTP/1.1 | |
Content-Type: multipart/form-data; boundary=AaB03x | |
--AaB03x | |
Content-Disposition: form-data; name="file1"; filename="file1.txt" | |
Content-Type: text/plain; charset=utf-8 | |
... content of file1.txt ... | |
--AaB03x-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="hidden" name="_charset_" /> |
OlderNewer