Skip to content

Instantly share code, notes, and snippets.

View kannan-anbu's full-sized avatar

Kannan Anbarasan kannan-anbu

  • Tamilnadu, India
View GitHub Profile
@carcinocron
carcinocron / debugger pause beforeunload
Last active April 25, 2024 16:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@gelitenight
gelitenight / Example.java
Last active November 8, 2023 08:42
A way to easily traverse any view hierarchy in Android
/* basic usage */
ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
LayoutTraverser.build(new LayoutTraverser.Processor() {
@Override
public void process(View view) {
// do stuff with the view
}
}).traverse(root);