Skip to content

Instantly share code, notes, and snippets.

View andhikayuana's full-sized avatar
🌏
bertapa

Andhika Yuana andhikayuana

🌏
bertapa
View GitHub Profile
@andhikayuana
andhikayuana / README.MD
Created January 26, 2022 08:59 — forked from gabrielemariotti/README.MD
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

git for-each-ref --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authorname)%(end) %(color:reset)%(refname:strip=3)' --sort=authordate refs/remotes
@andhikayuana
andhikayuana / git-commit-template.md
Created January 13, 2022 09:12 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@andhikayuana
andhikayuana / ImageViewExtended.java
Created January 12, 2022 09:39 — forked from gipi/ImageViewExtended.java
Android: class to download remote resources and implemente Observer pattern and a simple extension of ImageView that use it.
package com.example.android;
import android.content.Context;
import android.widget.ImageView;
import android.util.AttributeSet;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation;
@andhikayuana
andhikayuana / HashUtils.kt
Created December 23, 2021 10:03 — forked from LongClipeus/HashUtils.kt
How to generate checksum hash for a file in Kotlin
import StringUtils.encodeHex
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.security.MessageDigest
object HashUtils {
const val STREAM_BUFFER_LENGTH = 1024
@andhikayuana
andhikayuana / s3etag.sh
Created December 23, 2021 06:53 — forked from emersonf/s3etag.sh
A Bash script to compute ETag values for S3 multipart uploads on OS X.
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 file partSizeInMb";
exit 0;
fi
file=$1
if [ ! -f "$file" ]; then
fun Project.android(): BaseExtension {
val android = project.extensions.findByType(BaseExtension::class.java)
if (android != null) {
return android
} else {
throw GradleException("Project $name is not an Android project")
}
}
fun BaseExtension.variants(): DomainObjectSet<out BaseVariant> {
/*
* Copyright 2017 Shazam Entertainment Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
@andhikayuana
andhikayuana / java_vs_kotlin.md
Created November 24, 2021 10:08 — forked from AnthonyNahas/java_vs_kotlin.md
Java vs Kotlin - the quick comparison

1. Types and Operators

Java

// variable
int x = 1;

// constant
final int y = 2; 
@andhikayuana
andhikayuana / allDependencies.gradle
Created October 26, 2021 08:20 — forked from matthiasbalke/allDependencies.gradle
List all Gradle Dependencies
/**
* List all Dependencies of main / subprojects for given configurations.
*/
task allDependencies {
doLast {
// only check defined configurations
def includedConfigurations = ['compile', 'testCompile', 'runtime']
def deps = [:]