Skip to content

Instantly share code, notes, and snippets.

@lrecknagel
lrecknagel / install_nodejs_and_yarn_homebrew.md
Created December 6, 2018 08:56 — forked from nijicha/install_nodejs_and_yarn_homebrew.md
Install NVM, Node.js, Yarn via Homebrew

Install NVM, NodeJS, Yarn via Homebrew

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Install NVM and NodeJS

  1. Install nvm via Homebrew
@lrecknagel
lrecknagel / 1.js
Created September 12, 2019 07:33 — forked from getify/1.js
quick sketch of CAF
btn.addEventListener("send-btn",onSend);
send = CAF(send);
var prevSend = Promise.resolve();
function onSend(evt) {
prevSend.finally(function f(){
prevSend = send(
CAF.timeout(1000,"send took too long."),
{ some: "data" }
)
@lrecknagel
lrecknagel / attachment_odoo11_example.py
Created December 2, 2019 07:19 — forked from CakJuice/attachment_odoo11_example.py
Generate attachment on Odoo 11
import base64
from odoo import models, fields, api
class SomeModel(models.Model):
_name = 'some.model'
field1 = fields.Char(string="Field 1")
field2 = fields.Boolean(string="Field 2")
@api.multi
@lrecknagel
lrecknagel / cursor.js
Last active April 16, 2020 05:12 — forked from mxriverlynn/1_example.js
node-oracledb cursor handling
// this code will turn an OUT cursor from the node-oracledb library
// and turn the data into an array objects that has the structure of
// [{NAME: value, NAME_2: value, NAME_N: value}, ...]
// where the NAME is the column name returned through the cursor
//
// Distributed freely under MIT License <http://mutedsolutions.mit-license.org>
// Copyright 2016 Muted Solutions, LLC. All Rights Reserved.
const EventEmitter = require("events");
const util = require("util");