- repo name can be anything (but usually they end in .git)
for synology NAS diskstations, you probably want your git repos under /volume1
#!/bin/sh | |
set -eu | |
# | |
# https://www.namecheap.com/support/knowledgebase/article.aspx/43/11/how-do-i-set-up-a-host-for-dynamic-dns | |
# | |
#FETCH="fetch -qo -" | |
# or for curl: | |
FETCH="curl -s" | |
# $1: your domain | |
# $2: subdomain to update use @ for TLD |
#!/bin/bash | |
## | |
#<UDF name="ssuser" Label="New user" example="username" /> | |
#<UDF name="sspassword" Label="New user password" example="Password" /> | |
#<UDF name="hostname" Label="Hostname" example="examplehost" /> | |
#<UDF name="website" Label="Website" example="example.com" /> | |
# <UDF name="db_password" Label="MySQL root Password" /> | |
# <UDF name="db_name" Label="Create Database" default="" example="Create database" /> |
# tool chain | |
xcode-select --install | |
# install homebrew | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# required libs | |
brew doctor | |
brew install boost --with-python | |
brew install boost-python |
class dotdictify(dict): | |
""" | |
life = { | |
'bigBang': { | |
'stars': { | |
'planets': {} | |
} | |
} | |
} |
# open our log file | |
so = se = open("stdout.log", 'a', 0) | |
# re-open stdout without buffering | |
sys.stdout = os.fdopen(sys.stdout.fileno(), 'a', 0) | |
# redirect stdout and stderr to the log file opened above | |
os.dup2(so.fileno(), sys.stdout.fileno()) | |
os.dup2(se.fileno(), sys.stderr.fileno()) |
import sys | |
from PyQt4.QtCore import Qt | |
from PyQt4.QtGui import * | |
class ElidedLabel(QLabel): | |
def paintEvent(self, event): | |
painter = QPainter(self) | |
metrics = QFontMetrics(self.font()) | |
elided = metrics.elidedText(self.text(), Qt.ElideRight, self.width()) |
class QCheckableHeaderView(QtGui.QHeaderView): | |
''' | |
Checkable QHeaderView. Column 0 contains a checkbox that emits | |
a signal when it's check state is updated. | |
''' | |
is_on = True | |
signal_checked = QtCore.pyqtSignal(bool) | |
def __init__(self, *args, **kwargs): | |
super(QCheckableHeaderView, self).__init__(*args, **kwargs) |
#!/usr/bin/env python | |
""" | |
Simple utility to parse the __doc__, __name__ and __author__ values from | |
a Python module. | |
""" | |
import sys | |
import ast | |
m = ast.parse(''.join(open(sys.argv[1]))) |