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
# adaption of https://gist.github.com/alexalemi/2151722 | |
# by da-h | |
# minor changes | |
import numpy as np | |
class Welford(object): | |
""" Implements Welford's algorithm for computing a running mean | |
and standard deviation as described at: | |
http://www.johndcook.com/standard_deviation.html |
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
#!/bin/bash | |
DNS=" | |
firstdns.com | |
seconddns.com | |
" | |
SERVER=dyndns.xxx/nic/update | |
USERNAME=xxx | |
PASSWORD=xxx |
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 re | |
def natural_keys(text): | |
return [ int(c) if c.isdigit() else c for c in re.split('(\d+)',text) ] | |
# example | |
my_list =['Hello1', 'Hello12', 'Hello29', 'Hello2', 'Hello17', 'Hello25'] | |
my_list.sort(key=natural_keys) | |
print(my_list) |
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
#!/bin/bash | |
# needs https://github.com/wmutils/core for wattr | |
eval $(xdotool getmouselocation --shell) | |
IFS=" " read -a window <<< $(wattr whxy $(bspc query -N -n focused)) | |
north=$(( Y - window[3])) | |
west=$(( X - window[2])) | |
width=${window[0]} | |
height=${window[1]} |