Skip to content

Instantly share code, notes, and snippets.

View csrocha's full-sized avatar
🏠
Working at home

Cristian Sebastian Rocha csrocha

🏠
Working at home
View GitHub Profile
@csrocha
csrocha / 000.js
Last active March 12, 2024 20:21
This code add a new input to the Chart website editor. It lets you retrieve data from the backend.
/** @odoo-module **/
import ChartWidget from "@website/snippets/s_chart/000";
import publicWidget from "@web/legacy/js/public/public_widget";
const FopChartGraph = publicWidget.registry.chart.extend({
init() {
this.rpc = this.bindService("rpc");
this._super.apply(this, arguments);
@csrocha
csrocha / init.vim
Created August 9, 2023 16:05
My neovim configuration to works as python IDE
call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'jiangmiao/auto-pairs'
Plug 'scrooloose/nerdcommenter'
Plug 'sbdchd/neoformat'
@csrocha
csrocha / outer_exception.py
Created August 27, 2021 13:57
This is an example to manage common finnally actions.
class F_Exception(ExceptionBase):
pass
class A_Exception(ExceptionBase):
pass
class B_Exception(ExceptionBase):
pass
def f():
def StatefulFunction(app, responseTopic):
connections = {}
@app.route('/<path:uri>')
def route(uri):
topic_request = Convert(request)
connection.push(topic_request)
connection.wait()
return connection.result
@csrocha
csrocha / gitkeep
Created October 9, 2015 16:02
Bash git scripts
#!/bin/bash
#
# This BASH script keep only one directory of many in the repository
#
#
# Usage:
#
# gitkeep [directory]
#
# Create one directory [directory] in the parent directory containing
@csrocha
csrocha / odoo-server
Last active October 7, 2015 22:29
Initial odoo script for init.d using odooenv
#!/bin/sh
### BEGIN INIT INFO
# Provides: odoo-server
# Required-Start: postgresql $remote_fs $syslog
# Required-Stop: postgresql $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Resource Management software
@csrocha
csrocha / 80-l10n-ar-fiscalprinters.rules
Created January 12, 2015 18:17
Archivo para dejar disponibles impresoras fiscales argentinas en linux. Hay que dejar el archivo en el directorio: /etc/udev/rules.d y reiniciar el udev (/etc/init.d/udev restart).
SUBSYSTEM=="usb", ATTR{idVendor}=="04b8", MODE="0664", GROUP="lp"
@csrocha
csrocha / nginx-odoo
Last active June 1, 2016 16:03
ngnix-openerp
server {
listen 80;
rewrite ^(.*)$ https://$host$1 last;
}
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/host.crt;
@csrocha
csrocha / openerp-server
Last active August 29, 2015 13:56
Init.d compatible script using oerpenv environment
#!/bin/sh
### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start: postgresql $remote_fs $syslog
# Required-Stop: postgresql $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@csrocha
csrocha / environment.yml
Last active December 26, 2015 19:49
Archivos environment.conf para soportar la localización argentina en la v7.0 y v8.0 de openerp, usando oerpenv
sources:
dir: '{root}/sources'
repos:
odoo:
url: https://github.com/odoo/odoo.git
branch: 9.0
method: setup
addons:
config: '__openerp__.py'
reports: