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
| package Net::Zemanta::Suggest::HTTPS; | |
| use strict; | |
| use base qw( Net::Zemanta::Suggest ); | |
| sub suggest { | |
| my $self = shift; | |
| my $suggestions = $self->SUPER::suggest(@_); |
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
| cmdline = ['rsync', '--delete', '-az', src_path, dst_path] | |
| self.log.debug("rsync from %r to %r: %r" % (src_path, dst_path, cmdline)) | |
| self.subprocess.check_call(cmdline) |
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
| Index: munin-2.0.6/master/lib/Munin/Master/GraphOld.pm | |
| =================================================================== | |
| --- munin-2.0.6.orig/master/lib/Munin/Master/GraphOld.pm 2014-05-04 00:39:12.000000000 +0200 | |
| +++ munin-2.0.6/master/lib/Munin/Master/GraphOld.pm 2014-05-04 00:42:49.620605473 +0200 | |
| @@ -1161,7 +1161,8 @@ | |
| . "#" . ( | |
| $single_value | |
| ? "ff0000" | |
| - : $COLOUR[($field_count - 1) % @COLOUR])); | |
| + : $COLOUR[($field_count - 1) % @COLOUR]) |
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
| # vim:ts=4 sw=4 expandtab softtabstop=4 | |
| import json | |
| import jsonschema | |
| def main(): | |
| record = json.load(open("blank-ocds.json")) | |
| schema = json.load(open("../standard/standard/schema/record-schema.json")) | |
| jsonschema.validate(record, schema) | |
| main() |
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
| py32-latest create: /home/avian/dev/opencontracting/jsonmerge/.tox/py32-latest | |
| py32-latest installdeps: jsonschema | |
| ERROR: invocation failed, logfile: /home/avian/dev/opencontracting/jsonmerge/.tox/py32-latest/log/py32-latest-1.log | |
| ERROR: actionid=py32-latest | |
| msg=getenv | |
| cmdargs=[local('/home/avian/dev/opencontracting/jsonmerge/.tox/py32-latest/bin/pip'), 'install', 'jsonschema'] | |
| env={'PYTHONIOENCODING': 'utf_8', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'WINDOWPATH': '7', 'LOGNAME': 'avian', 'USER': 'avian', 'GNOME_KEYRING_CONTROL': '/home/avian/.cache/keyring-im0pyK', 'LC_PAPER': 'sl_SI.UTF-8', 'PATH': '/home/avian/dev/opencontracting/jsonmerge/.tox/py32-latest/bin:/home/avian/src/depot_tools:/home/avian/local/eagle-5.11.0/bin:/home/avian/local/bin:/home/avian/syn/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin', 'DISPLAY': ':0', 'SSH_AGENT_PID': '12184', 'LANG': 'en_US.utf8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_COOKIE': '4aaab8b188ece36029e4747a00000014-1407223324.605827-1316331910', |
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
| class Player: | |
| """Base class for the algorithm controlling a receiver and/or transmitter. | |
| Users should derive their own classes from this one and override | |
| methods as necessary. | |
| class MyPlayer(Player): | |
| ... | |
| The system creates two instances: one controlling the receiver and one |
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
| # pizza.py | |
| class DoughFactory(object): | |
| def get_dough(self): | |
| return 'insecticide treated wheat dough' | |
| class Pizza(DoughFactory): | |
| def order_pizza(self, *toppings): |
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
| ### Hettinger's way | |
| # robot.py | |
| class Robot(object): | |
| def move(self): | |
| print('Movement') | |
| class CleaningRobot(Robot): | |
| def clean(self): |
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 traceback | |
| import re | |
| def debug_var(a): | |
| s = traceback.extract_stack(limit=2)[0][3] | |
| g = re.match("\w+\((\w+)\)", s) | |
| print("%s = %r" % (g.group(1), a)) | |
| def main(): | |
| foo=1 |
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 | |
| import re | |
| import subprocess | |
| import sys | |
| import time | |
| import datetime | |
| def parse_date(date): | |
| dt = datetime.datetime.strptime(date, "%b %d %H:%M:%S %Y GMT") |
OlderNewer