Skip to content

Instantly share code, notes, and snippets.

View adiroiban's full-sized avatar
🇺🇦
Slava Ukraini!

Adi Roiban adiroiban

🇺🇦
Slava Ukraini!
  • VGR, La Gomera
  • 13:27 (UTC +01:00)
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!"
@lvh
lvh / client.py
Created July 6, 2012 08:37
Twisted file upload
import random
import StringIO
from zope import interface
from twisted.internet import abstract, defer, reactor
from twisted.web import client, http_headers, iweb
class _FileProducer(object): # pragma: no cover
"""
@vojtajina
vojtajina / e2e-tests.js
Created February 15, 2012 23:41
Angular: Scenario runner explanation
// simple dsl just wrapping angular's dsl, just providing higher abstraction
angular.scenario.dsl('submitMessage', function() {
return function(message) {
// these dsl already register futures (add fn into the queue),
// so you don't wrap them into addFutureAction
input('modelValue').enter(message);
element('button.submit').click();
};
});
@rubic
rubic / salt-minion.conf
Created January 15, 2012 20:17
Upstart configuration file for salt-minion
# salt-minion.conf
description "salt-minion upstart daemon"
author "Jeff Bauer <jbauer@rubic.com>"
# copy this file to /etc/init
start on (net-device-up and local-filesystems)
stop on shutdown
expect fork