Skip to content

Instantly share code, notes, and snippets.

View ataube's full-sized avatar

Andreas Taube ataube

  • collect.ai
  • Hamburg
View GitHub Profile
@ataube
ataube / JsonObjectMapper.java
Created January 3, 2013 14:52
Spring 3.2 Custom JSON Serialization with Jackson ObjektMapper with XML Configuration
//imports...
public class JsonObjectMapper extends ObjectMapper {
@Autowired
WebApplicationContext context;
public JsonObjectMapper() {
SimpleModule module = new SimpleModule();
module.addSerializer(MyDomainType.class, new TestSerializer(context));
@ataube
ataube / angular_srv_fac_prov_patterns.js
Created December 29, 2012 16:56
Difference between Angular service, factory and provider pattern Taken from http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};
});
//factory style, more involved but more sophisticated
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
connect: {
server: {
options: {
port: 9001,
@ataube
ataube / batch_rename.sh
Created November 23, 2012 09:44
Svn Batch Rename
#!/bin/bash
for i in *.tpl; do
j=`echo $i | sed 's/.tpl/.hbs/g'`;
svn ren $i $j;
done
@ataube
ataube / argsToArray.js
Created October 21, 2012 18:30
Dynamically converts function args to an array
var myFunction = function() {
var args = Array.prototype.slice.call(arguments, 0, arguments.length);
//do and return something
}