Skip to content

Instantly share code, notes, and snippets.

View ovnicraft's full-sized avatar
🎯
Focusing

Christian Salamea ovnicraft

🎯
Focusing
View GitHub Profile
@ovnicraft
ovnicraft / Nginx Gunicorn
Last active December 10, 2015 04:58
OpenERP deployment with Gunicorn and Nginx
Deployment
La version 6.1 y 7.0 de openerp ahora soporta multihilo y depende de www.gunicorn.org que es el software que hace que use todos los cpus.
Dentro de la carpeta del server existe un archivo gunicorn.conf.py en donde se configura los parametros del sistema
Entonces ejecutamos la instruccion
gunicorn openerp:wsgi.core.application -c gunicorn.conf.py
desde le path del server y veremos como algunos hilos se ejecutan con el sistema automagicamente.
Probamos en el localhost:8069 y esta correcto.
# This is a really old post, in the comments (and stackoverflow too) you'll find better solutions.
def find(key, dictionary):
for k, v in dictionary.iteritems():
if k == key:
yield v
elif isinstance(v, dict):
for result in find(key, v):
yield result
elif isinstance(v, list):
@selenamarie
selenamarie / liberate.sql
Last active December 17, 2015 17:29
I wrote this as prep for a talk about JSON datatype and PLV8: https://speakerdeck.com/selenamarie/schema-liberation-with-json-and-plv8-and-postgres
CREATE SCHEMA liberated;
CREATE OR REPLACE FUNCTION public.liberate()
RETURNS boolean
LANGUAGE plv8
AS $function$
var tables = plv8.execute(
"select relname FROM pg_catalog.pg_class"
+ " c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace"
@florentx
florentx / myaddon_test.py
Created June 24, 2013 11:44
Integration between Python unit-tests and OpenERP <assert/>
# -*- coding: utf-8 -*-
import unittest
from openerp.myaddon.util import osv_unittest
class MyTests(unittest.TestCase):
def test_upper(self):
self.assertEqual('dn_vn_nsn'.upper(), 'DN_VN_NSN')
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active June 14, 2024 17:01
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@ovnicraft
ovnicraft / gist:7917105
Last active December 31, 2015 01:49
cities.state
INSERT INTO `cities_state` (`id`, `code`, `name`, `country`) VALUES
(29, '201', 'AZUAY', 'EC'),
(30, '202', 'BOLIVAR', 'EC'),
(31, '203', 'CAÑAR', 'EC'),
(32, '204', 'CARCHI', 'EC'),
(33, '206', 'CHIMBORAZO', 'EC'),
(34, '205', 'COTOPAXI', 'EC'),
(35, '107', 'EL ORO', 'EC'),
(36, '108', 'ESMERALDAS', 'EC'),
(37, '420', 'GALAPAGOS', 'EC'),
@ovnicraft
ovnicraft / gist:7917124
Created December 11, 2013 19:47
cities_city
INSERT INTO `cities_city` (`id`, `name`, `code`, `state_id`) VALUES
(3, 'CAMILO PONCE ENRIQUEZ', '20115', 29),
(4, 'CHORDELEG', '20111', 29),
(5, 'CUENCA', '20101', 29),
(6, 'EL PAN', '20112', 29),
(7, 'GIRON', '20102', 29),
(8, 'GUACHAPALA', '20114', 29),
(9, 'GUALACEO', '20103', 29),
(10, 'NABON', '20104', 29),
(11, 'OÑA', '20110', 29),
@ovnicraft
ovnicraft / odoo_requirements.txt
Last active August 29, 2015 14:00
librerías de python requeridas para la instalación de Odoo 7.0
Babel==1.3
Cython==0.20.2
Jinja2==2.7.2
Mako==0.9.1
MarkupSafe==0.18
Pillow==2.5.1
http://download.gna.org/pychart/PyChart-1.39.tar.gz
PyYAML==3.10
Werkzeug==0.9.4
argparse==1.2.1
@ovnicraft
ovnicraft / gist:2b56223aee8a4ec7dd24
Created September 5, 2014 01:03
odoo 7.0 icons
color-picker.png gtk-paste-v.png stock_gantt.png STOCK_ZOOM_OUT.png
gtk-about.png gtk-preferences.png STOCK_GO_BACK.png terp-accessories-archiver-minus.png
gtk-add.png gtk-print.png STOCK_GO_DOWN.png terp-accessories-archiver.png
gtk-apply.png gtk-print-preview.png STOCK_GO_FORWARD.png terp-accessories-archiver+.png
gtk-bold.png gtk-properties.png STOCK_GOTO_BOTTOM.png terp-account.png
gtk-cancel.png gtk-quit.png STOCK_GOTO_FIRST.png terp-administration.png
gtk-cdrom.png gtk-redo.png STOCK_GOTO_LAST.png terp-calendar.png
gtk-clear.png gtk-refresh.png STOCK_GOTO_TOP.png terp-call-start.png
gtk-close.png gtk-remove.png STOCK_GO_UP.png t
@ovnicraft
ovnicraft / server-vars.yml
Last active August 29, 2015 14:11
server-vars
edx_platform_repo: "https://github.com/cecep-edu/edx-platform.git"
edxapp_use_custom_theme: true
edxapp_theme_name: 'stanford'
edxapp_theme_source_repo: https://github.com/cecep-edu/upex-theme.git
edxapp_theme_version: 'master'
edxapp_platform_name: 'formaX'
edx_tech_support_email: 'info@cecep-iaen.edu.ec'
edxapp_contact_email: 'info@cecep-iaen.edu.ec'
edapp_bugs_email: 'info@cecep-iaen.edu.ec'
edxapp_default_from_email: 'info@cecep-iaen.edu.ec'