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
export PS1="[\t] \[$(tput sgr0)\]\[\033[38;5;11m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\h:\[$(tput sgr0)\]\[\033[38;5;6m\][\w]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]" | |
# Virtualenv | |
export WORKON_HOME=~/.virtualenvs | |
source /usr/local/bin/virtualenvwrapper.sh | |
## Use a long listing format ## | |
alias ll='ls -la' |
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 multiprocessing | |
import logging | |
import subprocess | |
from django.core.management.base import BaseCommand | |
import time | |
from products.models import ProductFeed | |
log = logging.getLogger('xxx.fetcher') | |
log.info('Starting feed parser') |
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
from datetime import date, timedelta | |
KEEP_DAYS = 7 | |
KEEP_WEEKS = 4 | |
KEEP_MONTHS = 6 | |
today = date.today() | |
def calculate_daily_days(): | |
return [today - timedelta(days=day) for day in range(0, KEEP_DAYS)] |
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
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from scrapy.selector import HtmlXPathSelector | |
from kamertje.items import KamertjeItem | |
import sqlite3 as sqlite | |
from scrapy import log | |
class KamertjeSpider(CrawlSpider): | |
name = "kamertje" | |
allowed_domains = ["www.kamertje.nl", "kamertje.nl"] |
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
#!/usr/bin/env python | |
from sys import argv, exc_info | |
from mechanize import Browser | |
from datetime import datetime | |
from subprocess import call | |
pdfreader = '/usr/bin/okular' | |
if len(argv) == 3: |