I hereby claim:
- I am balazs-endresz on github.
- I am balazsendresz (https://keybase.io/balazsendresz) on keybase.
- I have a public key whose fingerprint is 3727 0479 E105 6395 5C45 8027 D395 7C0A A4A5 7980
To claim this, I am signing this object:
| -- https://wiki.postgresql.org/wiki/Disk_Usage | |
| -- This version of the query uses pg_total_relation_size, which sums total disk space used by the table including indexes and toasted data rather than breaking out the individual pieces: | |
| SELECT nspname || '.' || relname AS "relation", | |
| pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" | |
| FROM pg_class C | |
| LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
| WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
| AND C.relkind <> 'i' | |
| AND nspname !~ '^pg_toast' |
| git stash save --keep-index |
| #! /bin/sh | |
| ldapsearch -x -h localhost -b dc=example,dc=org,dc=uk \ | |
| '(&(objectClass=existingObjectClass)(!(objectclass=newObjectClass)))' dn \ | |
| |awk '/^dn: / { print $2 }' \ | |
| | ( | |
| while read line; do | |
| printf 'dn: %s\nchangetype: modify\nadd: objectClass\nobjectClass: newObjectClass\n\n' "$line" | |
| done | |
| ) \ |
| from django.views.debug import SafeExceptionReporterFilter, CLEANSED_SUBSTITUTE | |
| class CustomExceptionReporterFilter(SafeExceptionReporterFilter): | |
| """ Add this is to the settings: | |
| DEFAULT_EXCEPTION_REPORTER_FILTER = 'path.to.CustomExceptionReporterFilter' | |
| """ | |
| def get_post_parameters(self, request): | |
| post_parameters = super(CustomExceptionReporterFilter, self).get_post_parameters(request) | |
| cleansed = post_parameters.copy() | |
| // ==UserScript== | |
| // @name projects.torchbox.com tweaks | |
| // @namespace https://projects.torchbox.com/ | |
| // @version 2 | |
| // @match https://torchbox.codebasehq.com/* | |
| // @match https://projects.torchbox.com/* | |
| // @grant none | |
| // @noframes | |
| // ==/UserScript== | |
| /* jshint -W097 */ |
| sorted(set(sorted_list), key=lambda x: sorted_list.index(x)) |
| import ast | |
| from django.templatetags.static import static as django_static | |
| def strict_static(path): | |
| """ | |
| A stricter version of the static() function provided by django-libass: | |
| https://github.com/torchbox/django-libsass#custom-functions | |
| Raises an exception if a file is not found. Not for production use. | |
| """ |
| | grep -E '[0-9]{4,10} msecs'|grep -Eo '(POST|GET) [^ ]*|[0-9]* msecs' | sed -r '$!N;s/([^\n]*)\n([^\n]*)/\2 \1/' |sort -n |
I hereby claim:
To claim this, I am signing this object:
| from django.core.exceptions import ValidationError | |
| from django.utils.deconstruct import deconstructible | |
| from wagtail.wagtailcore.models import Page | |
| from wagtail.wagtailcore.utils import resolve_model_string | |
| @deconstructible | |
| class PageTypeValidator(object): | |
| """ |