Skip to content

Instantly share code, notes, and snippets.

@apan1000
apan1000 / birdspecies.js
Created September 27, 2023 21:52
Copy list of bird species from ebird.org
var species = Array.from(document.getElementsByTagName('section'))
.filter((section) => section.classList.contains('Observation'))
.filter((section) => section.children.length > 1 && section.children[0].children.length > 0)
.map((section) => section.children[1].innerText)
.join('\n');
const newDiv = document.createElement('div');
newDiv.style.background = 'mistyrose';
newDiv.style.borderRadius = '10px';
newDiv.style.padding = '25px';
private fun ClosedRange<Int>.random() =
Random().nextInt(endInclusive - start) + start
private fun getVote(vote: Boolean): Single<Boolean> {
return Single.just(vote)
.delay((1000..3000).random().toLong(), TimeUnit.MILLISECONDS)
}
private fun getConsensus(voteList: List<Boolean>): Boolean? {
return Observable.fromIterable(voteList)