- Setup your redis server
- Install python-rq
- Clone this gist
- Start n workers
- Run tas_rq.py
- Wait workers do the job :)
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
| for addr_id in O.ResPartnerAddress.search([]): | |
| addr = O.ResPartnerAddress.get(addr_id) | |
| vals = {} | |
| for field in ('phone', 'mobile'): | |
| if getattr(addr, field): | |
| addr_val = getattr(addr, field) | |
| updated = ''.join([x for x in addr_val if x.isdigit()]) | |
| if len(updated) == 9: | |
| vals[field] = updated |
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
| pg_dump --no-owner -T ir_attachment* $DBNAME \ | |
| | sed -e 's/\t\\\\x[a-z0-9]*//g' -e 's/ logo,//g' > $DBNAME.sql |
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/env sh | |
| if [ -z $VIRTUAL_ENV ]; then | |
| echo "**ERR: No virtualenv active" | |
| exit 1 | |
| fi | |
| if [ ! -e $VIRTUAL_ENV/bin/postgres ]; then | |
| echo "**ERR: No postgres binary for this virtualenv: ${VIRTUAL_ENV}" | |
| exit 1 | |
| fi | |
| echo "Starting PostgreSQL for virtualenv: ${VIRTUAL_ENV}" |
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
| #!/bin/bash | |
| cd server/openerp/addons | |
| echo '* Netejant links...' | |
| find . -type l -exec rm -f {} \; | |
| ADDONS=`find ../../../addons -name '__openerp__.py' -exec dirname {} \;` | |
| echo '* Linkant mòduls' |
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
| from flask import Flask, request | |
| app = Flask(__name__) | |
| @app.route('/', defaults={'path': ''}, methods=['GET', 'POST', 'PUT', 'PATCH']) | |
| @app.route('/<path:path>', methods=['GET', 'POST', 'PUT', 'PATCH']) | |
| def main(path): | |
| print 'Path requested: %s' % path | |
| for key, value in request.headers: |
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
| db.tg_billing.ensureIndex({'_id': 1}, {background: true}) | |
| db.tg_billing.ensureIndex({'id': 1}, {background: true}) | |
| db.tg_billing.ensureIndex({'date_end': -1}, {background: true}) | |
| db.tg_billing.ensureIndex({'name': 1}, {background: true}) | |
| db.tg_billing.ensureIndex({'type': 1, 'name': 1, 'value': 1, 'period': 1}, {background: true}) | |
| db.tg_billing.ensureIndex({'date_end': -1, 'valid': 1}, {background: true}) |
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
| REC=3 | |
| FOUND=0 | |
| find_and_build_makefile() | |
| { | |
| echo "Searching in `pwd`..." | |
| res=$(find . -name 'Makefile') | |
| if [ -z $res ]; then | |
| cd .. | |
| else | |
| echo "Sphinx Makefile found!" |
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
| <xpath expr="//form/group[5]/group[1]" position="attributes"> | |
| <attribute name="attrs">[('informe','not in','(export_factures_desglossat', 'export_trams_potencia_i_municipi'))]}</attribute> | |
| </xpath> | |
| <xpath expr="//form/group[5]/group[2]" position="attributes"> | |
| <attribute name="attrs">[('informe','in','(export_factures_desglossat', 'export_trams_potencia_i_municipi'))]}</attribute> | |
| </xpath> |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add a new remote. Obviously, change the github url to match your project's URL. It ends up looking like this: