In a Django template file...
{% if last_updated %}Last Updated: {{ last_updated }}{% endif %}
{% endblock %}
Wait, where is last updated set?
$ grep -R "last_updated" . // where "." is the Django project directory
stuff
| var request = require('request'); | |
| var fs = require('fs'); | |
| var moment = require('moment'); | |
| var htmlToText = require('html-to-text'); | |
| var SerialPort = require('serialport').SerialPort, | |
| serialPort = new SerialPort('/dev/ttyAMA0', { | |
| baudrate: 19200 | |
| }), |
| sorted(queryset.filter(id__in=collection_list), key=lambda s: s.headline.lower().startswith(kwargs['query'])) | |
| # this way will do a sort of the queryset based on whether it starts with the search term | |
| sorted(self.model.objects.filter(id__in=collection_list), key=lambda s: kwargs['query'] in s.headline.lower(), reverse=True) | |
| # this way will do a sort of the queryset based on whether it's an exact match |
| var format_date = function(date) { | |
| var month_names = ["January", "February", "March", "April", "May", "June", | |
| "July", "August", "September", "October", "November", "December"]; | |
| js_date = new Date(date); | |
| formatted_date = month_names[js_date.getMonth()] + ' ' + js_date.getDate() + ', ' + js_date.getFullYear() | |
| + ', ' + js_date.getUTCHours() + ':' + js_date.getUTCMinutes(); | |
| if(js_date.getHours() < 12) { | |
| formatted_date += " a.m."; | |
| } else { |
In a Django template file...
{% if last_updated %}Last Updated: {{ last_updated }}{% endif %}
{% endblock %}
Wait, where is last updated set?
$ grep -R "last_updated" . // where "." is the Django project directory
stuff
| #project/project/__init__.py | |
| import project.settings | |
| import pymongo | |
| THE_MONGO_CLIENT = pymongo.MongoClient(settings.MONGO_HOST, settings.MONGO_PORT) | |
| #project/project/settings.py | |
| INSTALLED_APPS += 'utils' | |
| MONGO_HOST = 'localhost' #default |
| db.system.js.save( | |
| { | |
| _id: "indexAll", | |
| value: function() { | |
| colls = db.getCollectionNames(); | |
| for (var i = 0; i < colls.length; i++) { | |
| if (colls[i] != "system.indexes") { | |
| db[colls[i]].createIndex( {"$**":"text"}, {name: "TextIndex"}); | |
| } | |
| } |
| Object.prototype.equals = function(object) { | |
| if (Object.keys(this).length != Object.keys(object).length) { | |
| return false; | |
| } | |
| for (var i = 0; i < Object.keys(this).length; i++) { | |
| if (this[Object.keys(this)[i]] != object[Object.keys(object)[i]]) { | |
| return false; | |
| } | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> | |
| </head> | |
| <body> | |
| <iframe width="800" height="600" src="EMBED CODE HURR" frameborder="0" allowfullscreen></iframe> | |
| </body> | |
| </html> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- use Modernizr and Video.js for cross browser compatibility --> | |
| <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> | |
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> | |
| <link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <!-- for Video.js, the ID and class attributes are needed. |
| /* FOR LE TEMPLATE.PHP | |
| /* THIS CODE CALLS A CUSTOM PAGE.TPL FILE IF YOU HAVE A SPECIFIC CONTENT TYPE | |
| function plstwo_preprocess_page(&$vars) { | |
| if (isset($vars['node']->type)) { | |
| $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type; | |
| } | |
| } | |
| /* --------------- */ |