Skip to content

Instantly share code, notes, and snippets.

View efemoney's full-sized avatar
🖥️
Kotlin Mascot

Efeturi Money efemoney

🖥️
Kotlin Mascot
View GitHub Profile
@efemoney
efemoney / auto-project-dir.gradle.kts
Last active October 23, 2022 07:06
Gradle Settings script/code that allows you to have any (*matching*) directory structure for your gradle modules
val ProjectDescriptor.descendants: Sequence<ProjectDescriptor>
get() = children.asSequence().flatMap { sequenceOf(it) + it.descendants }
gradle.settingsEvaluated {
rootProject.descendants.forEach {
// Given path - :tooling:idea-plugin OR :tooling-idea-plugin
val path = it.path
// after splitting - [tooling, idea, plugin]
/**
# Please write a function that gets a text and tries to guess the possible languages of the text.
#
# Pangrams: Contains all the letters in an alpahabet of a language.
#
# English => The quick brown fox jumps over the lazy dog
# German => Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich
# Turkish => Pijamalı hasta yağız şoföre çabucak güvendi
#
private class PagerAdapter extends android.support.v4.view.PagerAdapter {
// ...
private final Pattern patternBullet = Pattern.compile("[a-zA-Z0-9 ]+\\n");
private final Pattern patternLine = Pattern.compile("~");
private final String[] descriptions = new String[]{
"Unlimited Albums\n~\n" +
"5 Customer Profiles\n~\n" +
package com.devone.haute.ui;
import android.app.ActivityManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Build;
public class HorizontalLineSpan extends ReplacementSpan {
private Context context;
public HorizontalLineSpan(Context context) {
this.context = context;
}
@Override
public class LineDrawable extends Drawable {
private Context context;
private final Paint paint;
public LineDrawable(Context context) {
this.context = context;
paint = new Paint();
paint.setStyle(Paint.Style.STROKE);