Skip to content

Instantly share code, notes, and snippets.

View hgoebl's full-sized avatar

Heinrich Goebl hgoebl

View GitHub Profile
@hgoebl
hgoebl / keybase.md
Created March 24, 2014 20:11
keybase.md

Keybase proof

I hereby claim:

  • I am hgoebl on github.
  • I am hgoebl (https://keybase.io/hgoebl) on keybase.
  • I have a public key whose fingerprint is 2775 3D55 76C5 FD7D A8D6 54A4 11CA 0DB2 5BD1 880D

To claim this, I am signing this object:

package com.goebl.david;
import junit.framework.TestCase;
public class TestSO23260208 extends TestCase {
public void testGet() throws Exception {
Webb webb = Webb.create();
Response<String> response = webb
@hgoebl
hgoebl / AngularJS-Guide-Print-CSS.md
Last active August 29, 2015 14:09
AngularJS Guide CSS for print

Obviously printing out the interactive AngularJS Guide is not a really good idea, I admit. But for whatever reason I like to study the guide with my text-marker while sitting in the garden.

I only added the following CSS to the file <angular.js-root>/docs/app/assets/css/docs.css.

After building (grunt, gulp) the files get served by node-static (because I always use this as ad-hoc web-server, even if grunt delivers the page through grunt server).

@hgoebl
hgoebl / TestWebb_LocalStackoverflow27980798.java
Created January 16, 2015 11:39
Example using DavidWebb HTTP-Client for a stackoverflow question
package com.goebl.david;
public class TestWebb_LocalStackoverflow27980798 extends AbstractTestWebb {
public static final String BASE_URL = "https://domain.com";
public static final String API_VER = "/v1";
public void testDownload() throws Exception {
String token = "token12345";
@hgoebl
hgoebl / gist:1503453
Created December 20, 2011 21:50
handle non-utf8 encoded XML files
case S.PROC_INST_ENDING:
if (c === ">") {
emitNode(parser, "onprocessinginstruction", {
name : parser.procInstName,
body : parser.procInstBody
})
if (parser.procInstName === "xml") {
var match = parser.procInstBody.match(/encoding\s*=\s*['"]([A-Za-z_0-9-]+)['"]/)
if (match) parser.encoding = match[1]
}
package com.goebl.david;
import junit.framework.TestCase;
import org.json.JSONObject;
public class TestWebb_LocalStackoverflow23678518 extends TestCase {
public void testPost() throws Exception {
JSONObject register = new JSONObject();
@hgoebl
hgoebl / gist:7446989
Last active December 28, 2015 04:59
Example code for window.onbeforeunload (not generally usable!) There are two event-handlers for loggedOut and loggedIn.
// App.logout is just a AJAX call doing logout
var App = {
// ...
logout: function () {
return $.ajax({
url: REST.postLogout,
type: 'POST'
});
@hgoebl
hgoebl / proxy-settings.json
Created November 28, 2013 16:43
not working configuration with node-http-proxy
{
"silent": false,
"pathnameOnly": true,
"router": {
"/tomcat": "127.0.0.1:8080",
"/static": "127.0.0.1:8888"
}
}
@hgoebl
hgoebl / gist:7984391
Created December 16, 2013 09:25
Example using DavidWebb with Google-API
package com.goebl.david;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Real world testing a Google API.
*
@hgoebl
hgoebl / gist:8261396
Created January 4, 2014 22:08
IntelliJ module definition for Android Library project for android-support-v7-appcompat
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
<option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>