Skip to content

Instantly share code, notes, and snippets.

View ferranpons's full-sized avatar
💯
Into Kotlin Multiplatform

Ferran Pons ferranpons

💯
Into Kotlin Multiplatform
View GitHub Profile
@Nikaoto
Nikaoto / CopyBytes.kt
Last active July 27, 2020 09:31
A function that copies data from input to output (in Kotlin and Java)
//A Kotlin object (singleton) that handles the copying with mulitple different arguments
object CopyBytes {
@Throws(IOException::class)
fun copy(input: InputStream, output: OutputStream) {
//Creating byte array
val buffer = ByteArray(1024)
var length = input.read(buffer)
//Transferring data
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active June 15, 2023 04:22
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
public class GlueItemsAdapter extends RecyclerArrayAdapter<GlueItem, GlueItemsAdapter.Holder> {
public GlueItemsAdapter(LayoutInflater inflater) {
super(inflater);
}
@Override
protected Holder onCreateViewHolder(LayoutInflater inflater, ViewGroup parent, int viewType) {
return new Holder(inflater.inflate(android.R.layout.simple_list_item_1, parent, false));
@webpapaya
webpapaya / deploy-changelog.sh
Last active July 17, 2020 03:59
Travis CHANGELOG.md generator
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$CHANGELOG_BRANCH" ]; then
echo "This commit was made against the $TRAVIS_BRANCH and not $CHANGELOG_BRANCH! Changelog not updated!"
exit 0
fi
gem install rack -v 1.6.4
gem install github_changelog_generator
@lopspower
lopspower / README.md
Last active March 28, 2024 20:45
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