Skip to content

Instantly share code, notes, and snippets.

@kodeshpa
kodeshpa / filtering.py
Created January 23, 2017 22:53 — forked from robgolding/filtering.py
Django Class-Based View Mixins: Part 2
class FilterMixin(object):
"""
View mixin which provides filtering for ListView.
"""
filter_url_kwarg = 'filter'
default_filter_param = None
def get_default_filter_param(self):
if self.default_filter_param is None:
raise ImproperlyConfigured(
@kodeshpa
kodeshpa / gist:709283e477b041be1b69
Last active October 22, 2015 17:24 — forked from mdrcode/gist:8815011
Premise Android Coding Test

Android Coding Test - Github Events API

This is a simple coding test intended to demonstrate the candidate's ability regarding:

  • Java
  • Android
  • Web Services
  • Offline Communication (docs, commit messages, etc)

Please do not spend more than a few hours on this, at max. If you do not complete the project, that is OK. The intent is to demonstrate your knowledge, skill, and communication as you approach a project (good, disciplined effort that gets 80% of the way in 2 hours is much better than a hacky, low-quality project that gets it 'done' in 1 hours).

- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}