Install debian maintainer's toolset:
apt-get install devscripts dh-make
import xmlrpclib | |
session_info = (None,None) | |
token = None | |
class CookieAwareTransport(xmlrpclib.Transport): | |
''' Enhance xmlrpclib.Transport so that it sends the | |
appropriate authn/authz headers | |
''' | |
def send_content(self, connection, request_body): |
# Create a branch named "feature-a" | |
git branch feature-a | |
# Switch to branch "feature-a" updating your working copy | |
git checkout feature-a | |
# Work ... | |
vim hello.py | |
vim README |
<?php | |
$expected_duration = new DateInterval("PT03H30M"); /* 03:30:00 or 3h 30min */ | |
$expected_at = new DateTime('now'); | |
$expected_at->add($expected_duration); | |
$formatter = new IntlDateFormatter('el_GR', IntlDateFormatter::LONG, IntlDateFormatter::SHORT); | |
print $formatter->format($expected_at); |
# | |
# Example configuration for .hgrc | |
# | |
[extensions] | |
extdiff= | |
graphlog= |
<pre><?php | |
//////////////////////////////////////////////////// | |
// See more at https://drupal.org/node/1343708 // | |
//////////////////////////////////////////////////// | |
// | |
// Filter entities based on several {entity,property,field}-based criteria | |
// |
import smtplib | |
import logging | |
from email.mime.text import MIMEText | |
class Mailer(object): | |
def __init__(self, host, port, username, password='', verbose=0): | |
self.smtp = None | |
self.host = host | |
self.port = int(port) | |
self.username = username |
import thrush | |
import thrush.rrd | |
import random | |
import math | |
from datetime import datetime, timedelta | |
now = datetime.now() | |
step = timedelta(seconds=30) | |
t0 = now - timedelta(seconds=3600) |
import os | |
import logging | |
import argparse | |
import ConfigParser as configparser | |
from paste.deploy.converters import asbool, asint, aslist | |
# | |
# Declare expected command-line arguments | |
# |
import sys | |
import os.path | |
import urllib2 | |
def download_file(url, dest_file): | |
try: | |
ifp = urllib2.urlopen(url, data=None) | |
with open(dest_file, 'wb') as ofp: | |
n = 0 | |
s = ifp.read() |