Skip to content

Instantly share code, notes, and snippets.

@dgozman
dgozman / description.md
Created October 2, 2020 04:35
Playwright network settled helper

Network Settled

This helper waits for requests initiated by the action to finish. It is similar to waitUntil: 'networkidle' option, but is designed to work with any action, like click.

Example usage:

const waitForNetworkSettled = require('./networkSettled');

// Wait for network settled after navigation,
@steven2358
steven2358 / ffmpeg.md
Last active June 21, 2024 06:00
FFmpeg cheat sheet
@arazabishov
arazabishov / CaptureScreenshots.java
Last active June 23, 2018 00:02
A JUnit Rule for capturing screenshots using Spoon
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target(METHOD)
@Retention(RUNTIME)
public @interface CaptureScreenshots {
String before() default "";
@Pulimet
Pulimet / AdbCommands
Last active June 21, 2024 16:29
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 20, 2024 23:52
Hyperlinks in Terminal Emulators

Droidcon Notes

Day 1

Classy Shark

  • Really cool tool http://www.classyshark.com for opening up any android executable and analyzing its content.
  • Great for debugging and setting up proguard stuff
  • Good for handling multidex-related questions
  • Good for analyzing dependencies
  • Has an easy to use GUI with a good search feature
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active June 10, 2024 15:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@JakeWharton
JakeWharton / ShampooRule.java
Last active August 31, 2023 15:47
Got flaky tests? Shampoo them away with a quick JUnit rule. Apache 2.
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/** Got flaky tests? Shampoo them away. */
public final class ShampooRule implements TestRule {
private final int iterations;
public ShampooRule(int iterations) {
if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations);
@JakeWharton
JakeWharton / gist:f50f3b4d87e57d8e96e9
Created February 7, 2015 01:59
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
// need to create a signing task for all possible output
variant.outputs.each { output ->
// create a signing task for this
SignApk signTask = project.tasks.create("sign${output.name.capitalize()}MyApk", SignApk)
// setup task info
signTask.conventionMapping.inputFile = { output.packageApplication.outputFile }
signTask.outputFile = project.file("$project.buildDir/outputs/apk/${project.archivesBaseName}-${output.baseName}-unaligned.apk")
// other configuration of the signing task go here.