This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.
It will run in the following way:
brew update
every day at 12:10brew upgrade
every day at 12:20
Compiling package 's3cli/1c5a91f02feff8a0e3a506ac51c4a3140e86f049'... Finished (00:00:04) | |
Compiling package 'ruby/589d4b05b422ac6c92ee7094fc2a402db1f2d731'... Finished (00:08:39) | |
Compiling package 'mysql/b7e73acc0bfe05f1c6cbfd97bf92d39b0d3155d5'... Finished (00:02:11) | |
Compiling package 'libpq/09c8f60b87c9bd41b37b0f62159c9d77163f52b8'... Finished (00:01:18) | |
Compiling package 'golang/1ad977ce1c6fdbf21485a79567ef3d8d4d280110'... Finished (00:03:05) | |
Compiling package 'powerdns/256336d00b1689138490c385c03ad3a8f54b4a9e'... Finished (00:00:10) | |
Compiling package 'director/0f1b09ec6bb28ea13d2e919e71dd7ccd8ab49313'... Finished (00:06:14) | |
Compiling package 'nats/0155cf6be0305c9f98ba2e9e2503cd72da7c05c3'... Finished (00:01:04) | |
Compiling package 'registry/3aa0993cb8739fd4f5c6fc1e0da8e1cfdf6df247'... Finished (00:06:20) | |
Compiling package 'bosh-google-cpi/22b47cafcd455cb8f94e164e2049a4976f4dce1c'... Finished (00:02:48) |
# When you upgrade web2py your should update app files that are important to web2py for properly functioning | |
# | |
# views/ | |
# appadmin.html | |
# generic.ics | |
# generic.load | |
# generic.rss | |
# layout.html | |
# generic.json | |
# generic.map |
#!/usr/bin/env python | |
"""Test functions from | |
http://stackoverflow.com/questions/28680896/how-can-i-get-the-3rd-friday-of-a-month-in-python | |
""" | |
import calendar | |
from datetime import date, datetime, time, timedelta | |
from itertools import islice | |
DAY = timedelta(1) |
var download = (filename, text) => { | |
var element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); |
#/usr/bin/env python | |
from pandas import np | |
from pandas.io.data import DataReader | |
def historical_volatility(sym, days): | |
"Return the annualized stddev of daily log returns of `sym`." | |
try: | |
quotes = DataReader(sym, 'yahoo')['Close'][-days:] |
remove your ~/.toprc (if any) | |
start "top" | |
press z | |
press V | |
press 1 | |
press y | |
press m m | |
press t t t | |
press W |
#include <Adafruit_NeoPixel.h> | |
#define PIN 1 | |
#define STRIPSIZE 16 | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) | |
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) |
import logging | |
from StringIO import StringIO as StringBuffer | |
logger = logging.getLogger('basic_logger') | |
logger.setLevel(logging.DEBUG) | |
### Setup the console handler with a StringIO object | |
log_capture_string = StringBuffer() | |
# log_capture_string.encoding = 'cp1251' | |
ch = logging.StreamHandler(log_capture_string) |
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com www.example.com subsite.com www.subsite.com another.com www.another.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |