Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇾

Matías Irland mirland

🇺🇾
View GitHub Profile
@mirland
mirland / AppColors.kt
Created May 13, 2021
Extending Material theme in Jetpack Compose - Blog Code
View AppColors.kt
@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 Apr 30, 2020
Record a video from an android device
View gist:18411a82ba63a334f7b4e41e804b2e67
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 Jun 5, 2020
Script to manage android secret keys
View build.gradle
apply from: rootProject.file('read_secrets.gradle')
apply plugin: 'com.android.application'
....
android {
defaultConfig {
buildConfigField 'String', 'SOMETHING_SECRET', getEnvVariable('SOMETHING_SECRET')
}
signingConfigs {
View fix_adb
#!/bin/bash
group=`id -g -n`
sudo chown root:$group adb
sudo chmod 4550 adb
sudo ./adb kill-server
View 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 Apr 22, 2019
SNAPSHOT Beta release using jenkins
View snapshot_build.sh
#!/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 Feb 13, 2017
OpenWrt Configuration
View .config
#
# 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 Nov 20, 2018
Regular Interval Delay, custom rx operator
View MinRegularIntervalDelay Rxjava 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.
*/