Skip to content

Instantly share code, notes, and snippets.

View arekrob's full-sized avatar

Arkadiusz Robiński arekrob

View GitHub Profile
@arekrob
arekrob / decorator_pattern_example.txt
Created September 21, 2016 13:21
Decorator pattern - a good example
interface IProduct {
getName();
getPrice();
}
class Product implements IProduct {
private $name;
private $price;
getName() {...}
@arekrob
arekrob / gist:2d7166d0a11030419c55
Last active August 29, 2015 14:01
MySQL Running Total
For example when I have table:
Id|Val
1 | 1
2 | 2
3 | 3
4 | 4
I'd like to get result like this: