Skip to content

Instantly share code, notes, and snippets.

@TomTasche
TomTasche / bloki_sample.html
Created August 3, 2011 20:07
Sample Bloki integration
<html>
<head>
<title>Bloki!</title>
<!-- It's *really* important to add these two lines *before* you add your own stylesheets!
Otherwise your style will break bad -->
<link href="http://bloki-engine.appspot.com/style/uservoice/horizontal_red.css"
rel="stylesheet" type="text/css" />
<script language='javascript'
src='http://bloki-engine.appspot.com/submit/submit.nocache.js'
@TomTasche
TomTasche / GWT_body.java
Created August 6, 2011 09:50
Accessing a page's body in GWT
RootPanel.getBodyElement();
@TomTasche
TomTasche / GWT_native.java
Created August 6, 2011 09:45
Native methods in GWT rock! Here an example how to access the page's body.
private native Element getBody() /*-{
return document.getElementsByTagName('body')[0];
}-*/;
@TomTasche
TomTasche / GWT_body_2.java
Created August 8, 2011 10:21
Yet another method to access a page's body in GWT
Document.get().getBody();
@TomTasche
TomTasche / autoclose_objects.java
Created August 11, 2011 11:35
Auto-closing objects in Java 7
try (InputStreamReader reader = new InputStreamReader(null);
BufferedReader buffReader = new BufferedReader(null)) {
// do something
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@TomTasche
TomTasche / append_text.css
Created August 11, 2011 10:17
Adding text using CSS
.yetanotherdiv:before {
content: "tomtasche.at";
}
@TomTasche
TomTasche / positioing_css.css
Created August 11, 2011 10:18
Positioning in CSS
.yetanotherdiv {
position: fixed;
right: 10px;
bottom: 0;
}
@TomTasche
TomTasche / switch_string.java
Created August 11, 2011 10:26
Use strings in a switch
String name = "abc";
switch (name) {
case "Anton":
System.out.println("a");
break;
case "Berta":
System.out.println("b");
}
@TomTasche
TomTasche / multicatch.java
Created August 11, 2011 11:37
Multi-catches in Java 7
try {
// do something
} catch (IllegalArgumentException | ArithmeticException | NullPointerException e) {
// catch something
}
@TomTasche
TomTasche / gwt_dialogbox.html
Created August 18, 2011 09:19
GWT DialogBox
<div style="position: absolute; overflow-x: visible; overflow-y: visible; left: 346px; top: 0px; visibility: visible; " class="gwt-DialogBox"><div class="" title="Bloki - Crowdsourced typo fixjng"><table cellspacing="0" cellpadding="0" class=""><tbody><tr class="dialogTop"><td class="dialogTopLeft"><div class="dialogTopLeftInner"></div></td><td class="dialogTopCenter"><div class="dialogTopCenterInner"><div class="Caption">Bloki - Crowdsourced typo fixjng</div></div></td><td class="dialogTopRight"><div class="dialogTopRightInner"></div></td></tr><tr class="dialogMiddle"><td class="dialogMiddleLeft"><div class="dialogMiddleLeftInner"></div></td><td class="dialogMiddleCenter"><div class="dialogMiddleCenterInner dialogContent"><div class="gwt-HTML"><p>You probably ask yourself what this strange is. Well, it's Bloki.<br>Bloki helps a blog or website's owner to fix typos and missspellings. How? Using <b>your</b> help:<br>If you come across a typo or missspelling simply select the word / sentence and submit a correc