Skip to content

Instantly share code, notes, and snippets.

@malikwahab
malikwahab / rails http status codes
Created August 9, 2017 23:11 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@malikwahab
malikwahab / .py
Created October 13, 2016 22:03
How to add additional data to the response of Django's class-based generic views.
from from django.views.generic import TemplateView
# Works for all concreate class-based generic views
# except RedirectView and View
class ExampleView(TemplateView):
'''
override the get_context_class and pass the additional
data to it. Every class that Inherit the ContextMixin
implements this function.
'''