Skip to content

Instantly share code, notes, and snippets.

View jackbravo's full-sized avatar

Joaquin Bravo Contreras jackbravo

View GitHub Profile
@vstoykov
vstoykov / force_default_language_middleware.py
Last active June 6, 2024 10:51
Force Django to use settings.LANGUAGE_CODE for default language instead of request.META['HTTP_ACCEPT_LANGUAGE']
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class ForceDefaultLanguageMiddleware(MiddlewareMixin):
"""
Ignore Accept-Language HTTP headers
@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc

Download DrupalConsole

curl https://drupalconsole.com/installer -L -o drupal.phar

Make DrupalConsole globaly accesible

$ mv console.phar /usr/local/bin/drupal