Skip to content

Instantly share code, notes, and snippets.

Rx.Observable.create(o => {
console.log("subscribing");
o.onError(new Error("always fails"));
}).retryWhen(attempts -> {
return attempts.zip(Rx.Observable.range(1, 3), (n, i) => i).flatMap(i => {
console.log("delay retry by " + i + " second(s)");
return Rx.Observable.timer(i * 1000);
});
}).subscribe();
@staltz
staltz / introrx.md
Last active May 1, 2025 10:51
The introduction to Reactive Programming you've been missing
@arnabdas
arnabdas / example.html
Created August 1, 2013 08:13
Tri-State Checkbox in AngularJS
<!-- http://plnkr.co/edit/N98IKTcHoZMCs18FjSRF?p=preview -->
The directive assumes that the checkboxes array contains objects that have an isSelected property and a desc property.
<tri-state-checkbox checkboxes="listelements"></tri-state-checkbox>
or
<!-- http://plnkr.co/edit/PTnzedhD6resVkApBE9K?p=preview -->
If you prefer to have the directive only render the tri-stated checkbox, hence the individual checkboxes are in the HTML:
<tri-state-checkbox checkboxes="listelements" class="select-all-cb">
</tri-state-checkbox>select all
@Kalyse
Kalyse / arrowgasm.less
Created May 9, 2012 13:55
LessCSS Mixing for Providing Arrows
.arrowgasm(@position: top, @size : "4px", @background-color : #88b7d5, @border-width: "2px", @border-color : #c2e1f5, @arrowClass : "arrow_box"){
(~".@{arrowClass}") {
position: relative;
background: @background-color;
border: @size solid @border-color;
}
(~".@{arrowClass}:after"), (~".@{arrowClass}:before") {
bottom: 100%;
border: solid transparent;