Skip to content

Instantly share code, notes, and snippets.

@mmrko
mmrko / git-zsh-checkout-autocomplete-local-only.md
Last active July 20, 2023 08:48
List only local branches when autocompleting git checkout (Zsh)
git config --global alias.checkoutr checkout
$EDITOR /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
+else
@jackinside
jackinside / TickTickProviderHelper
Last active October 9, 2023 14:56
A utility class to work with TickTick's Content Provider. A full guide is available at https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
/**
* This class provides the URI, const values and some methods to work with TickTick's Content Provider.
*
* A guide is available on https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
*/
public class TickTickProviderHelper {
private static final Uri TASK_URI = Uri.parse("content://com.ticktick.task.data/tasks");
private static final Uri PROJECT_URI = Uri.parse("content://com.ticktick.task.data/tasklist");
private static final String TASK_CONTENT_ITEM_TYPE = "vnd.android.cursor.item/ticktick.task.task";