Skip to content

Instantly share code, notes, and snippets.

View codeflows's full-sized avatar

Jari Aarniala codeflows

View GitHub Profile
@codeflows
codeflows / ObservableType+GroupBy.swift
Created January 8, 2016 08:03
groupBy for RxSwift
extension ObservableType {
func groupBy<G: Equatable>(predicate: E -> G) -> Observable<Observable<E>> {
return distinctUntilChanged(predicate).map { first in
return self.startWith(first).takeWhile { predicate($0) == predicate(first) }
}
}
}

Keybase proof

I hereby claim:

  • I am codeflows on github.
  • I am codeflows (https://keybase.io/codeflows) on keybase.
  • I have a public key ASBU6i2ytuRkz9deiSHZknOzEaS2vATEkT9WP6lwTG_fJAo

To claim this, I am signing this object:

@codeflows
codeflows / kitteh.js
Created March 3, 2011 13:26
Kitteh bookmarklet
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.5.1",function($,L){$('img').each(function(){var w=$(this).width();var h=$(this).height();if(w&&h){var src='http://placekitten.com/'+w+'/'+h;$(this).attr('src',src);}});});
<!-- Gallery container element -->
<div id="photo-gallery">
<!-- Each photo set in its own element -->
<div class="photo-set">
<!-- Title, used when generating the photo set link listing -->
<h4 class="title">Embreach at Tavastia</h4>
<!-- Actual Flickr slideshow, id of format "flickr_user_id:flickr_set_id" -->
<div class="photos-flickr" id="embreach:72157624949768618"></div>
</div>
<!-- Set can be marked as default by adding CSS class "default-set" -->