View gitlabRemoveMovedFiles.gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
View EventWorkManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
View ThrottleTrackingBus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>>) { |
View EndlessRecyclerViewScrollListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |