Skip to content

Instantly share code, notes, and snippets.

View a2en's full-sized avatar
🎯
Focusing

Ameen Ahsan a2en

🎯
Focusing
View GitHub Profile
@a2en
a2en / main.dart
Last active April 21, 2022 09:32
twosum interview
// Given an array of integers `nums` and an integer `target`,
// return indices of the two numbers such that they add up to target.
//
// You may assume that each input would have exactly one solution, and you may not use the same element twice.
//
// You can return the answer in any order.
void main() {
check(twoSum([2, 7, 11, 15], 9),[0,1]);
check(twoSum([3,2,4], 6),[1,2]);
@a2en
a2en / DebounceTest.kt
Created November 4, 2020 09:27 — forked from k-kagurazaka/DebounceTest.kt
RxJava debounce like operator implementation for kotlin coroutine
launch(UI) {
editText.onTextChanged()
.debounce(1, TimeUnit.SECONDS)
.consumeEach {
Log.d("DebounceTest", "value: $it")
}
}
}
fun EditText.onTextChanged(): ReceiveChannel<String> =
@a2en
a2en / AnimatedFab.dart
Last active November 29, 2018 12:10
Flutter:Animated fab which supports CircularNotchedRectangle()
import 'package:flutter/material.dart';
class AnimatedFab extends StatefulWidget {
final Function() onPressed;
final String tooltip;
final IconData icon;
AnimatedFab({this.onPressed, this.tooltip, this.icon});
@override