Skip to content

Instantly share code, notes, and snippets.

@voidove
voidove / gist:93733a8a1a2b0875fddbd9264919df16
Created February 15, 2017 10:51 — forked from Mithrandir0x/gist:3639232
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!"
@voidove
voidove / dabblet.css
Created November 25, 2016 04:18
margin collapse
/**
* margin collapse
*/
ul {
background: red;
}
ul li{
list-style-type: none;
width: 40px;
height: 20px;
@voidove
voidove / dabblet.css
Last active November 24, 2016 09:48
margin collapse
/**
* margin collapse
*/
ul {
background: red;
clear: both;
//overflow: hidden;
//border: 1px solid;
}
ul li{
@voidove
voidove / dabblet.css
Last active September 23, 2016 07:02
three column absolute
/**
* three column absolute
*/
.wrapper {
position: relative;
}
.left {
width: 200px;
height: 200px;
@voidove
voidove / dabblet.css
Last active September 21, 2016 08:24
equal height column
/**
* equal height column
*/
.parent {
border: 1px solid;
float: left;
overflow: hidden;
}
.child {
float: left;
@voidove
voidove / dabblet.css
Last active September 21, 2016 08:02
equal height column
/**
* equal height column
*/
.wrapper {
border: 1px solid;
float: left;
}
.child {
 background: grey;
float: left;
@voidove
voidove / dabblet.css
Last active September 14, 2016 03:00
vertical-align
/**
* vertical-align
*/
.test1 {
border: 1px solid;
//line-height: 0;
}
img {
vertical-align: baseline;
}
@voidove
voidove / dabblet.css
Last active September 12, 2016 08:31
line-height value
/**
* line-height value
*/
p, div {
border: 1px solid;
margin: 10px;
}
h3 {
font-size: 20px;
}
@voidove
voidove / dabblet.css
Last active September 9, 2016 02:09
box-shadow
/**
* box-shadow
*/
div {
height: 30px;
background: lightgrey;
margin: 0 auto;
width: 300px;
//box-shadow: inset 2px 0 red, inset -2px 0 red, inset 0 -2px red;
box-shadow: inset 2px 2px green, inset -2px -2px red;
@voidove
voidove / dabblet.css
Created September 6, 2016 09:06
line-height and font-size
/**
* line-height and font-size
*/
.test1 {
font-size: 0;
line-height: 24px;
border: 1px solid;
background: grey;
}
.test2 {