This file contains 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
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/") t) | |
(package-initialize) | |
(require 'use-package) | |
(setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory)) | |
(load custom-file) |
This file contains 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 python3 | |
# -*- coding=utf-8 -*- | |
""" This script requires acpi to be installed """ | |
import math | |
import subprocess | |
import sys | |
# Output | |
batt_info = subprocess.check_output("acpi").split(b',') | |
batt_info = [l.strip() for l in batt_info] |
This file contains 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 math, subprocess, sys | |
batt_info = subprocess.check_output('acpi').split(b',') | |
batt_info = [l.strip() for l in batt_info] | |
percnt = int(batt_info[1][:-1]) | |
total_slots, slots = 10, [] | |
if batt_info[0].split()[-1] == 'Charging': |
This file contains 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 | |
# encoding: utf-8 | |
# Copyright 2013, 2016 T. Emil Rivera-Thorsen | |
# trive@astro.su.se | |
''' To run: python vp-interactive-py | |
''' | |
import scipy as sp | |
import scipy.constants as con |
This file contains 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 | |
from scipy.interpolate import InterpolatedUnivariateSpline as spline | |
class ErrorPropagationSpline(object): | |
""" | |
Does a spline fit, but returns both the spline value and associated uncertainty. | |
""" | |
def __init__(self, x, y, yerr, N=1000, *args, **kwargs): | |
""" | |
See docstring for InterpolatedUnivariateSpline |
This file contains 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
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a', | |
'#f781bf', '#a65628', '#984ea3', | |
'#999999', '#e41a1c', '#dede00'] |
This file contains 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 fill_between_steps(x, y1, y2=0, h_align='mid', ax=None, **kwargs): | |
''' Fills a hole in matplotlib: fill_between for step plots. | |
Parameters : | |
------------ | |
x : array-like | |
Array/vector of index values. These are assumed to be equally-spaced. | |
If not, the result will probably look weird... | |
y1 : array-like |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder