Skip to content

Instantly share code, notes, and snippets.

View pgreze's full-sized avatar

Pierrick Greze pgreze

View GitHub Profile
@pgreze
pgreze / devices.txt
Created September 9, 2020 03:43
Test Lab Available devices
┌───────────────────┬────────────────────┬──────────────────────────────────────┬──────────┬─────────────┬──────────────────────┬─────────────────────────────────────────────┐
│ MODEL_ID │ MAKE │ MODEL_NAME │ FORM │ RESOLUTION │ OS_VERSION_IDS │ TAGS │
├───────────────────┼────────────────────┼──────────────────────────────────────┼──────────┼─────────────┼──────────────────────┼─────────────────────────────────────────────┤
│ 602SO │ Sony │ Sony XZs │ PHYSICAL │ 1920 x 1080 │ 26 │ │
│ 801SO │ Sony │ Sony XZ3 801SO │ PHYSICAL │ 2880 x 1440 │ 28 │ │
│ A0001 │ OnePlus │ OnePlus One │ PHYSICAL │ 1920 x 1080 │ 22 │
@pgreze
pgreze / args.py
Created October 6, 2020 06:00
Provide all remaining bash arguments to a subscript
import sys
print(sys.argv)
@pgreze
pgreze / .gcloudignore
Last active October 16, 2020 08:31
Google Cloud Function allowing to expose private resources if accessed from a secured network
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
@pgreze
pgreze / run.main.kts
Created March 16, 2021 01:46
Allow to run multiple actions on demand in Kotlin script
import kotlin.Function0
import kotlin.Function1
import kotlin.Function2
import kotlin.Function3
import kotlin.Function4
import kotlin.Function5
import kotlin.system.exitProcess
fun run(
vararg functions: Pair<String, Function<Any>>,
@pgreze
pgreze / config.yml
Last active February 7, 2023 23:36
Flank presentation
gcloud:
results-history-name: Flank for app_jp
timeout: 45m
record-video: true
use-orchestrator: true
test-targets:
- size large
environment-variables:
clearPackageData: true
device:
@pgreze
pgreze / gradle-memory.md
Last active May 27, 2021 09:33
About Gradle and memory declaration

From Gradle

About Configuring JVM memory:

The org.gradle.jvmargs Gradle property controls the VM running the build. It defaults to -Xmx512m "-XX:MaxMetaspaceSize=256m"

The JAVA_OPTS environment variable controls the command line client, which is only used to display console output. It defaults to -Xmx64m

But:

@pgreze
pgreze / secret.main.kts
Last active June 10, 2021 02:13
Google Secret Manager with Kotlin
@file:DependsOn("com.google.cloud:google-cloud-secretmanager:1.6.2")
import com.google.api.gax.core.FixedCredentialsProvider
import com.google.api.gax.rpc.PermissionDeniedException
import com.google.auth.oauth2.ServiceAccountCredentials
import com.google.cloud.secretmanager.v1.AccessSecretVersionResponse
import com.google.cloud.secretmanager.v1.ProjectName
import com.google.cloud.secretmanager.v1.SecretManagerServiceClient
import com.google.cloud.secretmanager.v1.SecretManagerServiceSettings
import java.io.File
@pgreze
pgreze / app\build.gradle.kts
Created July 7, 2022 07:42
Gradle multi projects task dependencies
tasks.register("createResources") {
doLast {
println("Create resources")
}
}
afterEvaluate {
tasks.getByName("createResources")
.finalizedBy(":scripts:pushPr")
// > Task with name ':scripts:pushPr' not found in project ':app'.
//tasks.getByName(":scripts:pushPr")
@pgreze
pgreze / App.kt
Last active May 11, 2023 04:24
Showcase how adding an optional parameter without @jvmoverloads breaks a library API
package gradle.deps.conflicts
import com.github.pgreze.process.process
import kotlinx.coroutines.runBlocking
fun main() {
runBlocking {
// Notice it's missing the Charset argument introduced in kotlin-process 1.4,
// and it's only appearing when running the app:
//
@pgreze
pgreze / journey-extract-notes-from-sqlite.py
Created November 20, 2022 10:42
Extract notes from a journey.cloud sqlite database
'''Extract notes from a journey.cloud sqlite database.
First install journey.cloud on OSX,
locate the database files in folder
~/Library/Containers/com.journey.ios.app/Data/Library/Application\ Support/Journey/Journey.sqlite
and run this script with following arguments:
- the path to the sqlite database
- the directory to write notes into
'''