This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iconDir=~/Downloads | |
targetDir=~/Desktop | |
mkdir -p $targetDir/res/drawable-mdpi/ | |
mkdir -p $targetDir/res/drawable-hdpi/ | |
mkdir -p $targetDir/res/drawable-xhdpi/ | |
mkdir -p $targetDir/res/drawable-xxhdpi/ | |
mkdir -p $targetDir/res/drawable-xxxhdpi/ | |
find $iconDir/ -type d -name "drawable-mdpi" -exec find {} -type f -name "*.png" \; | xargs -I '{}' mv {} $targetDir/res/drawable-mdpi/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function prepareRequiredInfo { | |
GRADLE_PROPERTIES=$HOME"/code/gradle.properties" | |
export GRADLE_PROPERTIES | |
KEY_STORE_PATH=$HOME"/code/.misc/ead_keystore.jks" | |
export KEY_STORE_PATH | |
find $HOME -name "gradle.properties.sample" -exec printf "Found sample file: %s\n" {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Android Gradle CircleCI 2.0 configuration file | |
# Check https://circleci.com/docs/2.0/language-java/ for more details | |
# Suggestion: build the project by using ./gradlew lint test before using CircleCI | |
version: 2 | |
jobs: | |
build: | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-25-alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain | |
set +e | |
bootanim="" | |
failcounter=0 | |
timeout_in_sec=360 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import sys | |
from os.path import basename | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.utils import COMMASPACE, formatdate | |
# Usage: python send_email.py "me@mail.com" "pass" "receiver1@mail.com, receiver2@mail.com" "DEV" "ADT" "v1.2.3" "/Users/username/Desktop/log.txt,/Users/username/Desktop/dolog.txt" | |
send_from = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
./gradlew clean mergedJacocoReport | |
./gradlew jacocoFullReport | |
REPORT_PATH="file://$(pwd)/build/reports/jacoco/jacocoFullReport/html/index.html" | |
echo ${REPORT_PATH} | pbcopy | |
echo "Report available at:" | |
echo ${REPORT_PATH} | |
echo "Report file path copied to clipboard. You can paste it in your favorite browser. :)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Google Inc. | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.Observer | |
import java.util.concurrent.CountDownLatch | |
import java.util.concurrent.TimeUnit | |
fun <T> LiveData<T>.blockingObserve(): T? { | |
val countDownLatch = CountDownLatch(1) | |
var result: T? = null | |
val observer = Observer<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log | |
import androidx.test.espresso.IdlingRegistry | |
import com.jakewharton.espresso.OkHttp3IdlingResource | |
import okhttp3.Interceptor | |
import okhttp3.OkHttpClient | |
import okhttp3.Response | |
import okhttp3.mockwebserver.MockResponse | |
import okhttp3.mockwebserver.MockWebServer | |
import okhttp3.mockwebserver.QueueDispatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.porge.something.adapters | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewGroup | |
import kotlin.reflect.KClass | |
class AnyRvAdapter( | |
private val controllers: Map<KClass<*>, AnyRvItemController<*>>, | |
initialItems: List<Any> = emptyList(), |
OlderNewer