Skip to content

Instantly share code, notes, and snippets.

View fnagel's full-sized avatar

Felix Nagel fnagel

View GitHub Profile
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// 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!"
@amit
amit / Quic bookmarklet.js
Created March 22, 2011 23:47
Expanded Quix bookmarklet
javascript:Quix();function Quix() {
var e=encodeURIComponent; // shortcut for the function name
var t=window.getSelection ? window.getSelection():
(document.getSelection? document.getSelection(): (document.selection ? document.selection.createRange().text:'')); // Get selection or empty string
var c=window.prompt('Quix: Type `help` for a list of commands:');
if(t!='') {
if(c) {
c+=' '+t; // append selection to typed text
}
else {