Skip to content

Instantly share code, notes, and snippets.

@dherges
dherges / sms2graph.java
Created February 17, 2014 12:53
sms2graph
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
class sms2graph extends JFrame {
private static int WINDOW_X = 640;
private static int WINDOW_Y = 480;
@dherges
dherges / README.md
Last active August 29, 2015 14:01
typo3cms
curl -sS https://getcomposer.org/installer | php
php composer.phar install
@dherges
dherges / GeoQuery
Last active August 29, 2015 14:01
GeoQuery
/*
* Copyright 2014 David Herges <[email protected]>
* Licensed under MIT (http://opensource.org/licenses/MIT)
*/
define('M_NEGATIVE_PI_2', ((double) 0.0 - M_PI_2));
define('M_NEGATIVE_PI', ((double) 0.0 - M_PI));
define('M_2PI', ((double) 2.0 * M_PI));
/**
@dherges
dherges / SlingModelEnumValueMapInkjector.java
Created December 13, 2014 12:39
SlingModelEnumValueMapInjector
/*
* Copyright 2014 David Herges <[email protected]>
* Licensed under MIT (http://opensource.org/licenses/MIT)
*/
package org.apache.sling.models.extensions.injector;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
@dherges
dherges / CupboardCursorAdapter.java
Created November 3, 2015 14:45
Android: CursorAdapter -> Cupboard model -> UI ...
import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import nl.qbusict.cupboard.CursorCompartment;
import static nl.qbusict.cupboard.CupboardFactory.cupboard;
@dherges
dherges / README.md
Created January 29, 2016 20:29
Sling Handlebars.js
@dherges
dherges / .gitignore
Last active August 21, 2016 17:29
foo-ts2307
.DS_Store
node_modules/
dist/
@dherges
dherges / TwitterApiTest.java
Last active September 25, 2016 10:48
ok-testing-reloaded-medium
public class TwitterApiTest {
@Rule
public MockWebServerPlus server = new MockWebServerPlus();
private final OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
@Test
public void homeTimeline() throws IOException, InterruptedException {
// replay scripted http response from yaml file
@dherges
dherges / home_timeline.json
Created September 25, 2016 10:49
ok-testing-reloaded-medium
[
{
"coordinates": null,
"created_at": "Tue Aug 28 21:16:23 +0000 2012",
"favorited": false,
"id_str": "240558470661799936",
"text": "just another test",
"id": 240558470661799936,
"user": {
"name": "OAuth Dancer",
@dherges
dherges / TwitterApi.java
Last active September 25, 2016 10:52
ok-testing-reloaded-medium
/**
* Retrofit interface for Twitter REST API
*/
public interface TwitterApi {
@GET("statuses/home_timeline.json")
Call<ResponseBody> homeTimeline();
@GET("statuses/show/:id")
Call<ResponseBody> show(@Path("id") String id);