Skip to content

Instantly share code, notes, and snippets.

View j0nes2k's full-sized avatar

Jonas Kaufmann j0nes2k

  • Windfinder.com
  • Kiel, Germany
View GitHub Profile
@j0nes2k
j0nes2k / configurableinclude.py
Created January 28, 2014 17:30
Snippet of a Sphinx extension to allow global configuration of include paths via conf.py.
import sys
from docutils.parsers.rst import Directive
from docutils import nodes
# Usage:
# add this to conf.py:
# configurableinclude_paths = { 'module1': '/var/repositories/module1' }
#
# in your template, you can use:
@j0nes2k
j0nes2k / xAxis-formatter-localtime
Created November 5, 2013 09:26
Highcharts currently does not support setting different timezones. One workaround was to send data in local time and tell Highcharts to treat these timestamps as UTC timezones. Another solution is to send the data in UTC timezone and use a different xAxis formatter to adjust the timezone difference. This is just a starting point for others facin…
xAxis: {
type: 'datetime',
labels: {
align: 'center',
y: 15,
formatter: function(){
var datetime = moment.utc(this.value);
var utcOffset = 0;
// utcOffset should be set globally to whatever timezone you want to show