Skip to content

Instantly share code, notes, and snippets.

View joernroeder's full-sized avatar

Jörn Röder joernroeder

View GitHub Profile
@joernroeder
joernroeder / jQuery.sortUl.js
Created April 2, 2011 10:11
jQuery: sort items in a list by text
/**
* @description
* sort items in a list by text
*
* based on {@link http://stackoverflow.com/questions/1134976/how-may-i-sort-a-list-alphabetically-using-jquery}
*
* @param {String/Object} Selector or jQuery Object
* @param {Boolean} sort descending
*/
(function ($) {
<?php
class ExtensionName_RestApiExtension extends JJ_RestApiExtension {
public static $url_handlers = array(
'ExtensionName/$Action/$ID' => 'handleExtensionName'
);
public static $allowed_actions = array(
'handleExtensionName'
@joernroeder
joernroeder / AppConnector.pde
Created June 21, 2012 14:42
AppConnector.pde
import org.json.*;
import java.lang.reflect.Method;
class AppConnector extends Thread {
private boolean isDebug, available, running;
// app reload interval. will be updated from the server
private int interval = 500;
@joernroeder
joernroeder / RequestHandler.pde
Created June 21, 2012 15:53
RequestHandler.pde
import org.json.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
@joernroeder
joernroeder / AppConnector.h
Created July 11, 2012 11:51
AppConnector.h
/*
* AppConnector.h
* appConnector
*
* Created by Jonathan Pirnay & Jörn Röder.
* Copyright 2012 jj. All rights reserved.
*
*/
#include "ofMain.h"
@joernroeder
joernroeder / AppConnector.cpp
Created July 11, 2012 11:52
AppConnector.cpp
/*
* AppConnector.cpp
* appConnector
*
* Created by Jonathan Pirnay & Jörn Röder.
* Copyright 2012 jj. All rights reserved.
*
*/
#include "AppConnector.h"
@joernroeder
joernroeder / RequestHandler.h
Created July 11, 2012 11:55
RequestHandler.h
/*
* RequestHandler.h
* appConnector
*
* Created by Jonathan Pirnay & Jörn Röder.
* Copyright 2012 jj. All rights reserved.
*
*/
#include "ofMain.h"
@joernroeder
joernroeder / RequestHandler.cpp
Created July 11, 2012 11:55
RequestHandler.cpp
/*
* RequestHandler.cpp
* appConnector
*
* Created by Jonathan Pirnay & Jörn Röder.
* Copyright 2012 jj. All rights reserved.
*
*/
#include "RequestHandler.h"
@joernroeder
joernroeder / app.js
Created June 8, 2015 15:53
node vagrant, docker test app
var fs = require('fs'),
express = require('express'),
app = express(),
redis = require('redis').createClient(
process.env.REDIS_PORT_6379_TCP_PORT || 6379,
process.env.REDIS_PORT_6379_TCP_ADDR || '127.0.0.1',
{}
),
server = require('http').createServer(app);
@joernroeder
joernroeder / subclass-factory-example.js
Last active August 29, 2015 14:23
Javascript Factory example which returns different (Sub)Classes
// class pattern helpers
//
// @see https://stackoverflow.com/questions/1595611/how-to-properly-create-a-custom-object-in-javascript
//
Function.prototype.makeSubclass= function() {
function Class() {
if ('_init' in this)
this._init.apply(this, arguments);
}
Function.prototype.makeSubclass.nonconstructor.prototype= this.prototype;