Skip to content

Instantly share code, notes, and snippets.

@MurphyMc
MurphyMc / git_cola_icon_stage_unstage.diff
Created April 24, 2018 06:22
Patch git-cola so that clicking icon toggles staged/unstaged
diff --git a/orig.status.py b/usr/share/git-cola/lib/cola/widgets/status.py
index 4761228..852c057 100644
--- a/orig.status.py
+++ b/usr/share/git-cola/lib/cola/widgets/status.py
@@ -786,6 +786,23 @@ class StatusTreeWidget(QtWidgets.QTreeWidget):
"""Called when an item is double-clicked in the repo status tree."""
cmds.do(cmds.StageOrUnstage)
+ def mousePressEvent(self, event):
+ """Handle clicks on icon"""
@ctrl-freak
ctrl-freak / android-adb-pull-apk.md
Last active August 28, 2025 23:00
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@msrose
msrose / combining-git-repositories.md
Last active December 10, 2025 05:53
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.