Skip to content

Instantly share code, notes, and snippets.

View mbakgun's full-sized avatar

Burak Akgün mbakgun

View GitHub Profile
package com.dolap.events.helper.util
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dolap.events.helper.visibleitem.VisibleState
abstract class EndlessRecyclerViewScrollListener(private val mLinearLayoutManager: LinearLayoutManager) :
RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
package com.dolap.events.helper.visibleitem
import rx.Subscription
import rx.functions.Action1
import rx.subjects.PublishSubject
import rx.subjects.Subject
import java.util.concurrent.TimeUnit
class ThrottleTrackingBus(private val onSuccess: Action1<Set<Int>>) {
package com.dolap.events.data.workmanager
import android.content.Context
import androidx.work.*
import java.util.concurrent.TimeUnit
class EventWorkManager(appContext: Context) {
private val instance by lazy { WorkManager.getInstance(appContext) }
fun sendEvent(id: Int) = instance.beginUniqueWork(
for (var i = 100; i >= 0; i--) {
const changes = document.querySelector("#diffs > div.files.d-flex.gl-mt-2 > div.diff-tree-list.js-diff-tree-list.gl-px-5 > div.tree-list-holder.d-flex.flex-column > div.tree-list-scroll.pt-0.tree-list-blobs")
for (const child of changes.children) {
for (const baby of child.children) {
if (baby.getAttribute("viewed-files") != null) {
var greenCount = (baby.querySelector("div > div > span.file-row-stats.mr-1 > span.cgreen").textContent.trim()).replace('+', '');
var redCount = (baby.querySelector("div > div > span.file-row-stats.mr-1 > span.cred").textContent.trim()).replace('-', '');
if (greenCount == '0' && redCount == '0') {
baby.parentNode.removeChild(baby);
if (child.childElementCount == 1) {