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/python | |
| #-*- coding: utf-8 | |
| import os | |
| import glob | |
| from pybtex.database.input import bibtex | |
| from pyparsing import Word, alphanums, Literal | |
| auxfile = glob.glob("*.aux")[0] | |
| bibfiles = [] | |
| parser = bibtex.Parser() |
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
| def wrap_array_first_argument(f, derivatives_args=[], derivatives_kwargs={}): | |
| """ | |
| Wraps a function f into a function that also accepts numbers with | |
| uncertainties (UFloat objects) using uncertainties.wrap(). | |
| If the wrapped function is called with an array as first argument, the | |
| wrap iterates over all values and therefore the result will also be an | |
| array. | |
| """ | |
| def f_with_array_first_argument(*args, **kwargs): |
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
| import luigi | |
| import datetime | |
| import itertools | |
| import time | |
| class RangeInteger(luigi.tools.range.RangeBase): | |
| """ | |
| Instead of datetime with a specific resolution, we use a simple integer. | |
| The rangeBase is a bit inflexible regarding the parameter type, but we can | |
| work around it by parsing it to unix timestamps back and forth. |
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
| import luigi | |
| import uncertainties | |
| class UncertaintyParameter(luigi.Parameter): | |
| """ | |
| Implements luigi.Parameter for the uncertainties package. | |
| https://github.com/spotify/luigi/ | |
| https://github.com/lebigot/uncertainties | |
| """ | |
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
| import numpy as np | |
| import matplotlib.scale as mscale | |
| import matplotlib.transforms as mtransforms | |
| from matplotlib.ticker import Formatter, FixedLocator | |
| class FNumberScale(mscale.ScaleBase): | |
| name = 'fnumber' | |
| def __init__(self, axis, **kwargs): |
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
| #!/bin/bash | |
| ## | |
| ## Downloaded from https://astrofloyd.wordpress.com/2013/02/10/gitcheck-check-all-your-git-repositories-for-changes/ | |
| ## | |
| ## gitcheck: | |
| ## Check all git repositories in subdirectories, and list the ones with changes | |
| ## 30/07/2011, AstroFloyd, bzrcheck | |
| ## 18/01/2013, Astrofloyd, gitcheck | |
| # Initialise counters: |
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
| *.aux | |
| *.glo | |
| *.idx | |
| *.log | |
| *.toc | |
| *.ist | |
| *.acn | |
| *.acr | |
| *.alg | |
| *.bbl |
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
| app.filter('distance_of_time_in_words', -> | |
| (from_time, to_time, include_seconds) -> | |
| include_seconds = include_seconds || true | |
| to_time = to_time || 0 | |
| distance_in_minutes = Math.round(Math.abs(to_time - from_time) / 60 / 1000) | |
| distance_in_seconds = Math.round(Math.abs(to_time - from_time) / 1000) | |
| if 0 <= distance_in_minutes and distance_in_minutes <= 1 | |
| if !include_seconds | |
| if distance_in_minutes == 0 | |
| return 'less than 1 minute ago' |
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 -*- | |
| from matplotlib.table import Table | |
| from matplotlib.artist import allow_rasterization | |
| from matplotlib.text import Text | |
| import sig | |
| class LegendTable(Table): | |
| def __init__(self, ax, loc=None, bbox=None, title=None): | |
| Table.__init__(self, ax, loc, bbox) |
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
| [Unit] | |
| Description = Hyperion systemd service | |
| After = mediacenter.service | |
| [Service] | |
| Type = simple | |
| ExecStart = /usr/bin/hyperiond /etc/hyperion.config.json | |
| Restart = always | |
| [Install] |
NewerOlder