Skip to content

Instantly share code, notes, and snippets.


Rajagopal rajagopalx

View GitHub Profile
rajagopalx /
Created Jul 27, 2016 — forked from skyl/
Django Template macros with args and kwargs
# templatetags/ - Support for macros in Django templates
# Based on snippet by
# Author: Michal Ludvig <>
# modified for args and kwargs by Skylar Saveland
rajagopalx / .htaccess
Last active Jun 22, 2016 — forked from revolunet/.htaccess
global enable CORS without touching code
View .htaccess
# with AJAX withCredentials=false (cookies NOT sent)
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
RewriteEngine On
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]]
# with AJAX withCredentials=true (cookies sent, SSL allowed...)
SetEnvIfNoCase ORIGIN (.*) ORIGIN=$1