Skip to content

Instantly share code, notes, and snippets.

View nitinsurana's full-sized avatar

Nitin Surana nitinsurana

View GitHub Profile
List<Integer> parent_categories
************************************************************
HomeFragment
lstCategoryWrapper -> parent_categories.forEach(pc-> viewModel.getCategory(pc.id))
.stream()
.collect(List<LiveData<Resource<CategoryWrapper>>>)
lstCategoryWrapper.forEach(LiveData<Resource≤CategoryWrapper>>> liveData->{
@nitinsurana
nitinsurana / gist:c5737338d865626b49f5
Last active August 29, 2015 14:22
Slider for quickly navigating through all words in membean.com at "membean.com/trainers/{your_account}"
/**
* Ability to find a word by "text"
* Ability to navigate to a particular index
*/
var template = '<div><div id="words-iterator" style="position:absolute;top:0;left:0;width:50%;height:50%;margin-left:25%;margin-top:5%;z-index:1111;background:whitesmoke;text-align:center;padding-top:50px;"><h1></h1><p><span id="position-index"></span> of <span id="position-total"></span></p><p id="word-definition"></p>'+
'<div style="position: inherit;bottom: 10px;margin-left: 50%;">'+
'<p><input type="text" id="jumpIndex" style="width: 40px;padding: 0;"><span><button id="jumpToIndex" style="height: 23px;">Jump To Index</button></span></p>'+
'<button id="previous">Previous</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="next">Next</button></div></div><div style="opacity:0.5;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1110;background:yellow"></div></div>';
<script>
namespace = {abc:{person:{}}}
namespace.abc.common = function() {
var arr = [];
var setArr = function(v) {
if (v) {
arr.push(v);
}
}