Name: Kippt
URL: http://kippt.com/save/?url=${url}&title=${title}&source=greader
Icon URL: http://kippt.com/static/img/favicon.png
| # Add new server for organization YYYYYY | |
| /server add grove YYYYYY.irc.grove.io/6667 | |
| /set irc.server.YYYYYY.password "YYYYYY" | |
| # Set your username to BBBB | |
| /set irc.server.YYYYYY.username "BBBB" | |
| /set irc.server.YYYYYY.nicks "BBBB" | |
| # Set your password | |
| /set irc.server.YYYYYY.command "/msg NickServ identify xxxxxx" |
Name: Kippt
URL: http://kippt.com/save/?url=${url}&title=${title}&source=greader
Icon URL: http://kippt.com/static/img/favicon.png
| https://www.facebook.com/dialog/oauth?scope=email%2Cpublish_stream%2Coffline_access&state=&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fsocial%2Ffacebook%2Fcallback%2F&response_type=code&client_id=2645809696793984 |
| import re | |
| import simplejson | |
| from django.http import HttpResponse | |
| from django.conf import settings | |
| class JSONResponse(HttpResponse): | |
| def __init__(self, request, data): | |
| indent = 2 if settings.DEBUG else None |
| $(function() { | |
| var converter = new Showdown.converter(); | |
| $("#user_input").keyup(function(){ | |
| var txt = $("#user_input").val(); | |
| var html = converter.makeHtml(txt); | |
| $("#result").html(html) | |
| $("#html_result").val(html.replace(/>/g, ">\n").replace(/</g, "\n<").replace(/\n{2,}/g, "\n\n")); | |
| }); | |
| var sample = "#### Underscores\nthis should have _emphasis_\nthis_should_not\n_nor_should_this\n\n\ |
| _.extend Backbone.Router.prototype, { | |
| # load a new fragment, replacing the current history entry with the new fragment | |
| # this is used to prevent a back-button-redirect loop | |
| redirect:(fragment) -> | |
| Backbone.history.redirect(fragment) | |
| } | |
| _.extend Backbone.History.prototype, { | |
| redirect:(fragment) -> | |
| frag = (fragment || '').replace(/^#*/, '') |
| # Put this in your urls.py file after the admin.autodiscover() line. | |
| # --------------------------------------------------------------------------------- | |
| # Monkeypatch the Celery admin to show a column for task run time in the list view. | |
| from djcelery.admin import TaskMonitor | |
| from djcelery.models import TaskState | |
| admin.site.unregister([TaskState]) | |
| TaskMonitor.list_display += ('runtime',) | |
| admin.site.register(TaskState, TaskMonitor) |
| class ListResource(ModelResource): | |
| ''' | |
| API resource for lists | |
| Logged in user is mapped to the model using this: | |
| http://django-tastypie.readthedocs.org/en/latest/cookbook.html#creating-per-user-resources | |
| ''' | |
| class Meta: | |
| queryset = List.objects.all() |
| r = ListResource() | |
| lists = r.obj_get_list(request) | |
| lists_json = [] | |
| for list in lists: | |
| bundle = r.build_bundle(obj=list, request=request) | |
| lists_json.append(r.serialize(None, r.full_dehydrate(bundle), 'application/json')) |
| class EnvironmentResource(ModelResource): | |
| class Meta: | |
| queryset = Environment.objects.all() | |
| resource_name = 'environment' | |
| list_allowed_methods = ['get', 'post'] | |
| authentication = ApiKeyAuthentication() | |
| authorization = Authorization() | |
| def obj_create(self, bundle, request=None, **kwargs): | |
| return super(EnvironmentResource, self).obj_create(bundle, request, user=request.user) |