Skip to content

Instantly share code, notes, and snippets.

Peter Bengtsson peterbe

Block or report user

Report or block peterbe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@peterbe
peterbe / gist:2913338
Created Jun 11, 2012
A very practical decorator for Django Class Based Views
View gist:2913338
from django.utils.decorators import method_decorator
def class_decorator(decorator):
def inner(cls):
orig_dispatch = cls.dispatch
@method_decorator(decorator)
def new_dispatch(self, request, *args, **kwargs):
return orig_dispatch(self, request, *args, **kwargs)
cls.dispatch = new_dispatch
return cls
View default.diff
diff --git a/package.json b/package.json
index 7309e02..c9ef01f 100644
--- a/package.json
+++ b/package.json
@@ -1,83 +1,84 @@
{
- "name": "stump",
- "version": "0.1.0",
- "description": "An MDN futures experiment.",
- "private": true,
View default.txt
content
├── LICENSE.md
├── data
│   └── specifications.yaml
├── en-US
│   ├── css
│   │   └── reference
│   │   └── properties
│   │   └── transform
│   │   ├── examples
View redirect.txt
▶ redirect-chain https://developer.mozilla.org/en-US/docs/Window_Terminology
⚠️ Too many redirects! Will give up after 30 🌩
0 https://developer.mozilla.org/docs/en/Window_Terminology 302
1 > https://developer.mozilla.org/en-US/docs/en/Window_Terminology 301
2 >> https://developer.mozilla.org/en-US/docs/Window_Terminology 301
3 >>> https://developer.mozilla.org/docs/en/Window_Terminology 302
4 >>>> https://developer.mozilla.org/en-US/docs/en/Window_Terminology 301
5 >>>>> https://developer.mozilla.org/en-US/docs/Window_Terminology 301
6 >>>>>> https://developer.mozilla.org/docs/en/Window_Terminology 302
7 >>>>>>> https://developer.mozilla.org/en-US/docs/en/Window_Terminology 301
View default.txt
▶ python biggest-images.py 25
TOP 25 BIGGEST IMAGES...
1 files/14797/RDM%20Custom%20Device.gif 3.7MB
2 files/10771/06_Delete_card.gif 1.9MB
3 files/13803/b2gos.png 1.8MB
4 files/12131/Screen%20Shot%202015-12-09%20at%2010.23.46.png 1.8MB
5 files/16757/Screen_Shot_2019-06-20_at_11.16.17_AM.png 1.8MB
6 files/6303/open_cleo.gif 1.7MB
7 files/15493/57-inspector-starfish.png 1.5MB
8 files/10474/Screen%20Shot%202015-04-21%20at%205.51.49%20PM.png 1.3MB
View default.txt
▶ python biggest-images.py 25
TOP 25 BIGGEST IMAGES...
1 files/14797/RDM%20Custom%20Device.gif 3.7MB
2 files/10771/06_Delete_card.gif 1.9MB
3 files/13803/b2gos.png 1.8MB
4 files/12131/Screen%20Shot%202015-12-09%20at%2010.23.46.png 1.8MB
5 files/16757/Screen_Shot_2019-06-20_at_11.16.17_AM.png 1.8MB
6 files/6303/open_cleo.gif 1.7MB
7 files/15493/57-inspector-starfish.png 1.5MB
8 files/10474/Screen%20Shot%202015-04-21%20at%205.51.49%20PM.png 1.3MB
View settings.json
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"restructuredtext.confPath": "${workspaceFolder}/docs",
"python.pythonPath": "/Users/peterbe/Library/Caches/pypoetry/virtualenvs/kuma-zSqACmTg-py3.8/bin/python",
"python.formatting.blackPath": "/Users/peterbe/Library/Caches/pypoetry/virtualenvs/kuma-zSqACmTg-py3.8/bin/black",
"python.formatting.provider": "black",
"editor.rulers": [88],
"editor.formatOnSave": true
View default.diff
diff --git a/kuma/wiki/views/__init__.py b/kuma/wiki/views/__init__.py
index 2e966992c..0e6594525 100644
--- a/kuma/wiki/views/__init__.py
+++ b/kuma/wiki/views/__init__.py
@@ -1,8 +1,17 @@
-
-
import logging
-from . import (akismet_revision, code, create, delete, document, edit, # noqa
View default.diff
diff --git a/kuma/wiki/views/__init__.py b/kuma/wiki/views/__init__.py
index 2e966992c..6be6c7b25 100644
--- a/kuma/wiki/views/__init__.py
+++ b/kuma/wiki/views/__init__.py
@@ -1,8 +1,17 @@
-
-
import logging
-from . import (akismet_revision, code, create, delete, document, edit, # noqa
View files.txt
kuma/api/v1/serializers.py 1 different PRs
kuma/api/v1/tests/test_views.py 2 different PRs
kuma/api/v1/views.py 1 different PRs
kuma/core/apps.py 1 different PRs
kuma/core/checks.py
You can’t perform that action at this time.