Skip to content

Instantly share code, notes, and snippets.

View wmakeev's full-sized avatar
💭
💻

Makeev Vitaliy wmakeev

💭
💻
View GitHub Profile
@wmakeev
wmakeev / index.js
Last active January 23, 2023 05:20
[Test bookmarklet] #bookmarklet #test
import { addValue } from "./module2.js";
export const foo = (name) => {
console.log(`${addValue(name)} in index.js`);
};
window._my_foo = foo;
@wmakeev
wmakeev / createInternalOrdersFromSales.js
Last active September 1, 2024 13:12
[МойСклад - Букмарклеты] #moysklad #bookmarklet
/**
* Создание внутренних заказов для пополнения остатков магазинов по проданным
* за последние 7 дней товарам
*/
(async () => {
// Функция для отображения ошибки
const error = (msg) => {
alert(msg);
throw new Error(msg);
@wmakeev
wmakeev / report-stock-all-current.js
Last active January 21, 2023 06:25
[МойСклад - остатки] #moysklad #stock
// https://gist.githubusercontent.com/wmakeev/09aad933ef9bcb1a8804e3449ec5ff74
import { env } from "../env.js";
/**
* Возвращает остатки МойСклад
*
* @param {import('moysklad').Instance} ms
*/
export async function getMoyskladStock(ms) {
@wmakeev
wmakeev / GetMoyskladAttr.d.ts
Last active September 6, 2023 11:38
[МойСклад - часто используемые функции] #moysklad #tools #usefull #helpers
type GetMoyskladAttr = <
T extends import("moysklad-api-model").Attribute["type"]
>(
entity: { attributes?: import("moysklad-api-model").Attribute[] },
type: T,
id: string
) => Extract<import("moysklad-api-model").Attribute, { type: T }> | null;
@wmakeev
wmakeev / getDocumentsStream.js
Last active January 24, 2023 13:38
[МойСклад - entity streams] #moysklad #stream #generator
/**
* Возвращает товары способом обычного листания
*
* @param {import('moysklad').Instance} ms
* @param {string} path
* @param {import('moysklad').Query} query
*/
export async function* getDocumentsStream(ms, path, query) {
/** @type {string | undefined} */
let nextHref = ms.buildUrl(path, query)
@wmakeev
wmakeev / package.json
Last active November 13, 2023 06:31
[01 - Node.js ESM] #template #esm #node
{
"name": "example",
"version": "1.0.0",
"type": "module",
"description": "",
"exports": "./src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines": {
@wmakeev
wmakeev / README.md
Last active January 24, 2023 12:46
[Yandex.Cloud] #yandex #cloud #trigger #type
@wmakeev
wmakeev / Ozon.ts
Last active June 2, 2022 04:01
[OZON API wrapper] #ozon #api #marketplace
/*
# CHANGELOG:
- 2022-06-02 initial
*/
import type { fetch, FetchOptions } from "../tools/fetch-adapter";
export interface OzonOptions {
clientId: string;
@wmakeev
wmakeev / linux_config_tips.md
Last active December 24, 2022 10:51
[Linux config tips] #linux

Apple 101 keyboard setup

  • Functional keys fix

    echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf
  • System settings > Layouts > Options

@wmakeev
wmakeev / canon-mf4010-linux.md
Last active March 30, 2022 14:56
[Canon MF4010 Linux driver] #canon #mf4010

Установка принтера Canon MF4010

  1. Скачать Драйвер принтера UFR II/UFRII LT для Linux V5.40
  2. Распаковать и запустить sudo ./install.sh
  3. Далее выбрать модель принтера (регистрация принтера) и завершить установку

В самом начале был установлен Драйвер CQue DEB (не знаю нужен ли он по факту)