A simple way to mock calls to the Mandrill API from nodejs tests. It uses the amazing mockery
package.
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
#!/bin/sh | |
# we need some fixes from 14.10 | |
# sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3 | |
sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3 -y | |
# fetch this repository | |
sudo apt-get update -y | |
# update your libreoffice installation | |
sudo apt-get install libreoffice python3-uno -y | |
# get all build dependencies for libreoffice | |
sudo apt-get build-dep libreoffice -y |
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
[program:odoo] | |
user=openerp | |
directory=/home/openerp/odoo | |
command=odoo.py -c /home/openerp/odoo/openerp_serverrc.prod | |
environment=PATH="/home/openerp/odoo/venv/bin" | |
autostart=true | |
autorestart=true | |
stopsignal=QUIT | |
stopwaitsecs=30 | |
startsecs=5 |
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
This gist provides a simple setup to add Sentry logging to OpenERP/Odoo. | |
As Odoo's logging setup is rather limited, I'm using syslog to collect and forward logs to Sentry. | |
These scripts should run without any modification on an Ubuntu based server, assuming the paths and user names for openerp match with the ones in the `supervisord.conf` file. | |
To have rsyslog2sentry run fine, you'll need some python pagkages installed | |
$ pip install raven loggerglue |
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
$ brew --config | |
HOMEBREW_VERSION: 0.9.5 | |
ORIGIN: https://github.com/Homebrew/homebrew.git | |
HEAD: f92e7ec4077ebb226a9637b369db0e294a7afa8e | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit ivybridge | |
OS X: 10.9.2-x86_64 | |
Xcode: 5.1.1 | |
CLT: 5.1.0.0.1.1396320587 |
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
#!/bin/python | |
import os | |
from boto.s3.connection import S3Connection | |
import subprocess | |
from datetime import datetime, date | |
import argparse | |
import tempfile | |
import json | |
parser = argparse.ArgumentParser(description="Downloads logs from S3, and parses them with goaccess.") |
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 logging | |
import facepy as facebook | |
from django.conf import settings | |
from django.contrib.auth.signals import user_logged_in | |
from django.db import models | |
from django.contrib.auth import logout | |
from django.contrib.auth.models import User | |
class FBAuthMiddleware(object): | |
def __init__(self): |
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
''' A model field to store and retrieve Google Protocol Buffer objects easily. | |
Uses the BlobField available on GAE for storage. | |
Usage: | |
myfield = ProtobufField(protoclass=MyProtocolClass) | |
where MyProtocolClass is a protocol descriptor class generated from a .proto file. | |
The field is supposed to store only the given kind of protocol messages. |
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
var mongoose = require('mongoose'), | |
async = require('async'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId; | |
var MyS = new Schema({ | |
feeling: String | |
}); | |
MyS.pre('save', function(done){ | |
async.parallel([ |