Skip to content

Instantly share code, notes, and snippets.

import android.annotation.SuppressLint
import android.view.View
import android.view.ViewGroup
import android.view.Window
import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsCompat.Type.InsetsType
@abdallaadelessa
abdallaadelessa / selenium.main.kts
Last active August 30, 2022 08:01
This kotlin script opens a new google search page and search for **abdallaessa92** and then print the result stats
#!/usr/bin/env kotlin
@file:DependsOn("org.seleniumhq.selenium:selenium-java:3.141.59")
import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.interactions.Actions
import org.openqa.selenium.support.ui.ExpectedConditions
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.Single;
import io.reactivex.functions.BiFunction;
import io.reactivex.schedulers.Schedulers;
import java.util.List;
import java.util.Map;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
@abdallaadelessa
abdallaadelessa / CountriesServiceSolved.java
Created November 13, 2019 17:59
RxJava Challenge Solution
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.Single;
import io.reactivex.functions.BiFunction;
import io.reactivex.schedulers.Schedulers;
import java.util.List;
import java.util.Map;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.Scheduler;
import io.reactivex.Single;
import io.reactivex.functions.BiFunction;
import io.reactivex.schedulers.Schedulers;
import java.util.List;
import java.util.Map;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
@file:UseExperimental(ExperimentalContracts::class)
package de.android.kotlin
import java.io.Serializable
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**
* @author Created by Abdullah Essa on 2019-06-18.
import kotlin.random.Random
/*
[ 1]: ***************
[ 2]: ### ##### ##*
[ 3]: * # # *
[ 4]: * # # # # ### *
[ 5]: * ### ## *
[ 6]: * # # # # ### *
import kotlin.random.Random
/*
[ 1]: ************************************************************************
[ 2]: ## ### ## ## ### ### ### # # # ## # # # # # # ### # ## *
[ 3]: * ## # # # ## # # # # ## ### *
[ 4]: * # # # ## ### # # # ###### ## ##### ##### #### ## # *
[ 5]: * # ## #### ### ### ## ### # ## ## # ### # # ## # # *
[ 6]: * ## ## ### # ## ## ## # # # # # ### ### # # # # # # # ## ## # ## # *
/*
* 1 (0,0)
* 2 (0,1)
* 3 (0,2)
* 4 (1,2)
* 5 (2,2)
* 6 (2,1)
* 7 (2,0)
* 8 (1,0)
* 9 (1,1)
import java.lang.StringBuilder
/**
* Pyramid generator
*
* Develop a function which generates a pyramid:
*
* fun pyramidGenerator(levels: Int): List<String>
*