This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.shortcuts import render_to_response | |
| def error_404(request): | |
| response = render_to_response("web/error_404.html") | |
| response.status_code = 404 | |
| return response | |
| def error_500(request): | |
| response = render_to_response("web/error_500.html") | |
| response.status_code = 500 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import json | |
| from django.conf import settings | |
| from django.http import HttpResponse, HttpResponseBadRequest | |
| from django.contrib import messages | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.preloadImagesCSS = function() { | |
| var allImgs = [], | |
| k = 0, | |
| sheets = document.styleSheets; | |
| for (var i = 0; i<sheets .length; i++) { | |
| var cssPile = '', | |
| csshref = (sheets[i].href) ? sheets[i].href : 'window.location.href'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| sudo yum update | |
| sudo yum install java-1.7.0-openjdk.i686 -y | |
| wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz | |
| tar -xf elasticsearch.tar.gz | |
| rm elasticsearch.tar.gz | |
| mv elasticsearch-* elasticsearch | |
| sudo mv elasticsearch /usr/local/share |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chmod -R 777 tmp/ | |
| chcon -R -t httpd_sys_content_rw_t 'tmp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## views.py | |
| import tempfile | |
| import os | |
| import commands | |
| import cgi | |
| from django import http | |
| from django.views.decorators.csrf import csrf_exempt | |
| from django.shortcuts import render |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('a[rel="external"]').on({ | |
| click: function() { | |
| window.open($(this).attr('href')); | |
| return false; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function(e) { | |
| "use strict"; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <snippet> | |
| <description>cdata js</description> | |
| <content><![CDATA[ | |
| <script type="text/javascript"> | |
| //<![CDATA[ | |
| $0 | |
| //]]/> | |
| </script> | |
| ]]></content> | |
| <tabTrigger>cdatajs</tabTrigger> |