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
bl_info = { | |
"name": "Add Cube", | |
"description": "Adds a cube to the 3D View", | |
"author": "Your Name", | |
"version": (1, 0), | |
"blender": (2, 80, 0), | |
"location": "View3D > Add > Mesh", | |
"category": "3D View", | |
} |
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
// dont works | |
[ | |
{ | |
$addFields: { | |
quotation: { | |
$arrayElemAt: ["$quotations", 0], | |
}, | |
}, | |
}, | |
{ |
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
version: "3.1" | |
services: | |
dev_db: | |
container_name: dev_db | |
image: postgres | |
restart: always | |
environment: | |
POSTGRES_USER: db_admin | |
POSTGRES_PASSWORD: wasspord |
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
{ | |
type: "html", | |
props: { | |
html: ` | |
<div class="mt-5 mr-5 ml-5 mb-5"> | |
<label>My label</label> | |
<select handle:change="myHandler"> | |
<option>foo</option> | |
<option>bar</option> | |
</select> |
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
function filterOuput(inputObject, tree) { | |
const hierarchy = tree.split("."); | |
function filterChildren(parent, hierarchyLevel) { | |
const key = hierarchy[hierarchyLevel]; | |
for (const childKey of Object.keys(parent)) { | |
if (childKey === key || key === "*") { | |
if (hierarchy[hierarchyLevel + 1]) { | |
if (Array.isArray(parent[childKey])) { | |
for (const c of parent[childKey]) { | |
filterChildren(c, hierarchyLevel + 1); |
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
/* | |
Usage : | |
import db from "./db.js" | |
await db.query("select 1+:test", { test: 123 }) | |
*/ | |
import mysql from "mysql2"; | |
import toUnamedFactory from "named-placeholders"; | |
const toUnamed = toUnamedFactory(); |
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
// allow usage of Promise.all without vars remapping and lost scope | |
const createPromisesController = () => { | |
const items = []; | |
return { | |
add(promise, fn) { | |
items.push({ promise, fn }); | |
}, | |
async flushPromises() { | |
const values = await Promise.all(items.map((item) => item.promise)); | |
for (let i = 0; i < items.length; i++) { |
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
function deDuplicate(arr, getUnique) { | |
return [ | |
...new Set( | |
arr.map((i) => getUnique(i)) | |
), | |
].map((i) => | |
arr.find((a) => getUnique(a) === i) | |
); | |
} |
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
export class Page { | |
constructor({ active, index }) { | |
this.active = false; | |
this.items = []; | |
this.index = 1; | |
this.active = active; | |
this.index = index; | |
} | |
} | |
export class Pagination { |
NewerOlder