Skip to content

Instantly share code, notes, and snippets.

function test(...[, , thirdArg, ...otherArgs]) {
console.log(thirdArg, otherArgs);
}
test(1, 'two', 3, 4, 'five');
export GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_SSH_COMMAND="ssh -vvv" && git clone <URL>
@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");
@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 / github2Gitea.js
Created September 17, 2019 13:28
a small nodejs module to migrate a list of github repos (FROM A ORGANIZATION) to gitea
const fetch = require('node-fetch'),
FormData = require('form-data');
// your gitea domain without trailing slash
const GITEA_DOMAIN = 'https://subdomain.domain.xyz';
// you can find this variables when you visit your gitea installation
// open dev-tools and look in the Cookies section
const i_like_gitea = 'YOUR_I_LIKE_GITEA_STRING';
const gitea_awesome = 'YOUR_GITEA_AWESOME_STRING';
@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 / 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 / lumio_indexDB_dump.js
Created October 10, 2018 10:44
Lumio IndexDB extraction
// DB_NAME via: ChromeDev Tools -> Application Tab -> Indexed DB
// should be something like: _pouch_bank_MD5_HASH
const DB_NAME = "YOUR_DB_NAME";
indexedDB.open(DB_NAME, DB_VERSION = 5).onsuccess = function (evt) {
const db = this.result;
const transaction = db.transaction("by-sequence", 'readonly');
const objectStore = transaction.objectStore("by-sequence");
const index = objectStore.index("_doc_id_rev");
@lrecknagel
lrecknagel / expanding-flex-cards.markdown
Created October 8, 2018 07:38
Expanding flex cards
@lrecknagel
lrecknagel / .eslintrc.json
Last active August 4, 2020 14:50
eslint based on recommendation and some own rules
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 9