Skip to content

Instantly share code, notes, and snippets.

View theapache64's full-sized avatar
๐Ÿš
Focusing

theapache64 theapache64

๐Ÿš
Focusing
View GitHub Profile
@theapache64
theapache64 / mvvmize.sh
Created November 15, 2020 18:41
Add this to your .bashrc file
function mvvmize () {
# to hold local data source classes such as room,sqlite,realm etc.
mkdir -p data/local &&
# to hold remote data source such as Retrofit, OkHttp etc
mkdir -p data/remote &&
# to hold repository classes that will manage both local and remote data sources
mkdir -p data/repositories &&
@theapache64
theapache64 / sh.sh
Created November 13, 2020 09:13
Turn ON/OFF device animation using ADB
function animOff(){
adb shell settings put global window_animation_scale 0 &
adb shell settings put global transition_animation_scale 0 &
adb shell settings put global animator_duration_scale 0
}
function animOn(){
adb shell settings put global window_animation_scale 1 &
adb shell settings put global transition_animation_scale 1 &
๐Ÿ˜‡ Initializing auto-motion ...
๐Ÿ”Š Analyzing audio stream...
โœ”๏ธ Audio analysis finishednition: 100% |###########################| Time: 0:05:19
๐ŸŽฅ Analyzing video stream...
โœ”๏ธ Video analysis finished
๐ŸŽธ Analyzing BGM...
โ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธโ†”๏ธ
โ†ช Total BGM duration : 00:12:07
โ†ช Passed BGM duration : 00:03:41
โ— Remaining BGM needed : 00:08:26
@theapache64
theapache64 / pull_file.sh
Created October 3, 2020 11:01
Search and Pull File via ADB
function pull_file(){
filePath=$(adb shell find /storage/emulated/0 -iname "*$1*" | tr -d '\r' | xargs -n1)
x=$(echo "$filePath" | tr '\n' ' ' | xargs)
adb pull "$x"
}
package com.theapache64.mockitosample
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.MockitoAnnotations
object Calculator {
fun divide(a: Int, b: Int): Int {
return a / b
}
}
@RunWith(Parameterized::class)
class ParameterizedTest(
private val num1: Int,
private val num2: Int,
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
class DonutView(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
private val icingPathEffect = ComposePathEffect(
CornerPathEffect(50f),
DiscretePathEffect(80f, 50f)
@theapache64
theapache64 / Main.kt
Created February 15, 2019 05:58
Delegation Pattern `by` Kotlin
interface Car {
fun carMethod();
}
interface Bus {
fun busMethod();
}
class Leyland : Bus {
override fun busMethod() {
package com.tp.theah64.orchid.utils.extensions
import android.util.Log
fun Any.debug(message: String) {
Log.d(getTag(this), message)
}
fun Any.info(message: String) {
Log.i(getTag(this), message)
public class SplashActivity extends BaseAppCompatActivity implements SplashActivityNavigator {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
final SplashActivityViewModel viewModel = ViewModelProviders
.of(this,