Skip to content

Instantly share code, notes, and snippets.

View mirland's full-sized avatar
🇺🇾

Matías Irland mirland

🇺🇾
View GitHub Profile
@mirland
mirland / AppColors.kt
Created May 13, 2021 22:07
Extending Material theme in Jetpack Compose - Blog Code
@Stable
data class AppColors(
val subtitleTextColor: Color,
val materialColors: Colors,
){
val primary: Color
get() = materialColors.primary
// Add other material colors properties
}
@mirland
mirland / gist:18411a82ba63a334f7b4e41e804b2e67
Created April 30, 2020 18:01
Record a video from an android device
video2gif() {
ffmpeg -y -i "${1}" -vf fps=${3:-10},scale=${2:-320}:-1:flags=lanczos,palettegen "${1}.png"
ffmpeg -i "${1}" -i "${1}.png" -filter_complex "fps=${3:-10},scale=${2:-320}:-1:flags=lanczos[x];[x][1:v]paletteuse" "${1}".gif
rm "${1}.png"
}
record_gif() {
if [ -z "$1" ]; then
VIDEO_NAME=$(date +%F_%H-%M-%S)
@mirland
mirland / build.gradle
Last active June 5, 2020 08:45
Script to manage android secret keys
apply from: rootProject.file('read_secrets.gradle')
apply plugin: 'com.android.application'
....
android {
defaultConfig {
buildConfigField 'String', 'SOMETHING_SECRET', getEnvVariable('SOMETHING_SECRET')
}
signingConfigs {
#!/bin/bash
group=`id -g -n`
sudo chown root:$group adb
sudo chmod 4550 adb
sudo ./adb kill-server
@mirland
mirland / wifi_adb
Last active May 16, 2018 17:33
Wifi ADB
wifi_adb() {
PORT="$1"
if [ -z "$PORT" ]; then
PORT="5"
fi
re='^[0-9]+$'
if ! [[ $PORT =~ $re ]] ; then
echo "error: Not a number" >&2; return 1
fi
@mirland
mirland / snapshot_build.sh
Last active April 22, 2019 17:34
SNAPSHOT Beta release using jenkins
#!/bin/bash
echo "Current branch: $GIT_BRANCH"
MAIN_SNAPSHOT_BRANCH="origin/develop"
GRADLE_FILE="app/build.gradle"
CURRENT_COMMIT_HASH=$(git rev-parse --short HEAD)
IS_BETA_SNAPSHOT_BUILD=false
if [[ $GIT_BRANCH == $MAIN_SNAPSHOT_BRANCH ]] ; then # Cheks if this build is a beta release
@mirland
mirland / .config
Created February 13, 2017 00:27
OpenWrt Configuration
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_ppc44x is not set
# CONFIG_TARGET_realview is not set
# CONFIG_TARGET_arm64 is not set
# CONFIG_TARGET_sunxi is not set
@mirland
mirland / MinRegularIntervalDelay Rxjava operator
Last active November 20, 2018 16:07
Regular Interval Delay, custom rx operator
import java.util.Date;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
import timber.log.Timber;
/**
* Created by mirland on 26/02/16.
*/