Skip to content

Instantly share code, notes, and snippets.

View almozavr's full-sized avatar

Oleksii Malovanyi almozavr

  • Lviv, UA
View GitHub Profile
@almozavr
almozavr / .gitconfig
Created August 19, 2013 11:42
Nice global git config
# core {{{
[core]
excludesfile = /Users/almozavr/.gitignore_global
pager=less -x4
quotepath = false
pager = less
autocrlf = true
#}}}
# user {{{
@almozavr
almozavr / Git aliases for code review
Created August 19, 2013 11:36
Git code review aliases
[alias]
log-branch-only = "!f() { arg1=$1; if [[ $# -lt 2 ]] || [[ $2 == -* ]] ; then arg2=$arg1; arg1='HEAD'; arg3=${*:2}; else arg2=$2; arg3=${*:3}; fi; hash=`git merge-base $arg1 $arg2`; git log $hash..$arg2 $arg3; }; f"
[alias]
diff-branch-only = "!f() { arg1=$1; if [[ $# -lt 2 ]] || [[ $2 == -* ]] ; then arg2=$arg1; arg1='HEAD'; arg3=${*:2}; else arg2=$2; arg3=${*:3}; fi; hash=`git merge-base $arg1 $arg2`; git diff $hash..$arg2 $arg3; }; f"
@Override
protected void onStart() {
super.onStart();
App.uiBus.registerSticky(this);
}
@Override
protected void onStop() {
super.onStop();
App.uiBus.unregister(this);
public List<Class<?>> getEventTypesBySubscriber(Object subscriber) {
List<SubscriberMethod> subscriberMethods = subscriberMethodFinder.findSubscriberMethods(subscriber.getClass(), defaultMethodName);
List<Class<?>> eventTypes = new ArrayList<Class<?>>(subscriberMethods.size());
for (SubscriberMethod method : subscriberMethods) {
eventTypes.add(method.eventType);
}
return eventTypes;
}
public class BusFragment extends Fragment {
@Override
public void onStart() {
super.onStart();
App.uiBus.registerSticky(this);
}
@Override
public void onStop() {