Skip to content

Instantly share code, notes, and snippets.

@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:
@cmathew
cmathew / SampleBottomSheetTest.kt
Last active April 4, 2024 11:25
Outline for an Espresso test that interacts with BottomSheets in a reliable way
@Test
fun clickButtonInsideExpandedBottomSheet() {
val sheetBehavior = activity.getBottomSheetBehavior()
val expandedSheetIdlingResource = BottomSheetStateResource(sheetBehavior, STATE_EXPANDED)
val settledSheetIdlingResource = BottomSheetSettledResource(sheetBehavior)
// Wait for settled state
withBottomSheetResource(settledSheetIdlingResource) {
// Use BottomSheetSetStateAction to expand the Bottom Sheet
}
#!/bin/bash
# Firebase service account decrypt
- openssl aes-256-cbc -K $encrypted_XXXXXXXXXXXX_key -iv $encrypted_XXXXXXXXXXXX_iv
-in service-account.json.enc -out service-account.json -d
# Install Google Cloud SDK
wget --quiet --output-document=/tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
mkdir -p /opt
tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
/opt/google-cloud-sdk/install.sh --quiet
#!/bin/bash
export UUID=$(uuidgen)
export PLATFORM=$1
export RESULT_FOLDER=./${PLATFORM}_results
SECONDS=0
# run test on firebase
echo -e "\n * * * * * * RUN $PLATFORM TESTS * * * * * * \n"
@0mega
0mega / extract_bucket_name.sh
Created November 21, 2019 11:38
Extract firebase bucket URL from Firebase Test Lab results
#!/usr/bin/env bash
FILE_TO_PARSE=$1
echo "Parsing file: $FILE_TO_PARSE"
# Matches the bucket url
awk -F"[" '/\[http.*.*test-lab-.*\]/{ print $2 }' ${FILE_TO_PARSE} | sed 's/.]//'
@Lider123
Lider123 / test_lab_for_android.sh
Last active February 7, 2023 23:26
Script for running instrumented test in firebase test lab.
# Preparing wget
apt-get update
apt-get upgrade -y
apt install python2.7 python-pip -y
apt-get install wget
# Install Google Cloud SDK
wget --quiet --output-document=/tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
mkdir -p /opt
tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 3, 2024 11:24
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
desc "Upload APK to Slack channel"
private_lane :upload_to_slack do |options|
file_path = lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
file_name = file_path.gsub(/\/.*\//,"")
access_token = ENV["ACCESS_TOKEN"]
channel_name = "apks"
sh "echo Uploading " + file_name + " to Slack"
sh "curl https://slack.com/api/files.upload -F token=\"" + access_token + "\" -F channels=\"" + channel_name + "\" -F title=\"" + file_name + "\" -F filename=\"" + file_name + "\" -F file=@" + file_path
end
desc "Build a signed release APK & deploy to slack"
lane :slack_apk_build do
gradle(
task: "assemble",
build_type: "Release",
print_command: false,
properties: {
"android.injected.signing.store.file" => ENV['KEYSTORE_PATH'],
"android.injected.signing.store.password" => ENV['STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['KEY_ALIAS'],
# Add your SLACK_URL & ACCESS_TOKEN HERE
SLACK_URL="https://hooks.slack.com/services/..."
ACCESS_TOKEN = "xoxp-106043..."
# Private Keystore Information
KEYSTORE_PATH="/path/to/your/.jks" # Example: /Users/thedancercodes/keystores/keystore.jks
STORE_PASSWORD="store_password"
KEY_ALIAS="key_alias"
KEY_PASSWORD="key_password"