Skip to content

Instantly share code, notes, and snippets.

@bagus2x
bagus2x / TwitterDatePicker.kt
Created March 22, 2023 18:16
Jetpack compose twitter date picker (dob). Jetpack Compose scrollable date picker.
package bagus2x.sosmed.presentation.common.components
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.pager.VerticalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material.MaterialTheme
@Cranked
Cranked / Converter.java
Created June 26, 2022 10:24
Convert bytes to KB,MB,GB,TB,PB,EB,ZB,YB
public String getFileSize(long size, int round) {
if (size <= 0)
return "0";
final String[] units = new String[]{"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
return String.format("%." + round + "f", size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
}
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active May 22, 2024 05:49
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@lopspower
lopspower / README.md
Last active May 23, 2024 07:29
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store