Skip to content

Instantly share code, notes, and snippets.

@premraj10
premraj10 / gist:94d4ee1c45d747dff9196d5854c7dc06
Created May 7, 2017 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
View gist:94d4ee1c45d747dff9196d5854c7dc06
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@premraj10
premraj10 / CGLibProxySample.java
Created May 20, 2016 — forked from ksauzz/CGLibProxySample.java
Proxy sample code with java.lang.reflect.Proxy and CGLib
View CGLibProxySample.java
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
public class CGLibProxySample {
@SuppressWarnings("unchecked")