Skip to content

Instantly share code, notes, and snippets.

View wmakeev's full-sized avatar
💭
💻

Makeev Vitaliy wmakeev

💭
💻
View GitHub Profile
@wmakeev
wmakeev / README.md
Created April 23, 2017 18:27 — forked from PeterHancock/README.md
Running a node script on your $PATH with --harmony flag

Running a node script on your $PATH but with the --harmony flag

Some npm packaged scripts are written as frameworks that dynamically require user node scripts, e.g. the gulp CLI script requires the user provided Gulpfile.js (by default).

To write .js using ES6 syntax is problematic; if the $PATH script for a framework x looks like

#!/usr/bin/env node
var x = require('x');

...
@wmakeev
wmakeev / 1 - simple.js
Last active May 19, 2017 17:34
Обновление позиций МойСклад JSON API
async function reserveCustomerOrder (orderId) {
// получаем заказа
let customerorder = await moysklad.GET(['entity/customerorder', orderId], { expand: 'positions' })
// убеждаемся что все позиции загружены, если нет, то подгрузим оставщиеся
let positions = await moysklad.loadPositions(customerorder.positions, { limit: 100 })
// ставим позиции в резерв
positions.forEach(pos => {
pos.reserve = pos.quantity
/// <reference path="../../node_modules/mutation-summary/src/mutation-summary.ts" />
namespace $ {
export interface $tools_dom_mutation_options {
query: () => $tools_dom_mutation_query
root_node?: () => Node
old_previous_sibling?: () => boolean
observe_own_changes?: () => boolean
}
@wmakeev
wmakeev / onEdit_cell_add.json
Last active December 23, 2017 08:04
Google App Script Spreadsheet events
{
"authMode":{},
"range":{
"columnStart":13,
"rowStart":85,
"rowEnd":85,
"columnEnd":13
},
"source":{},
@wmakeev
wmakeev / cloudant.js
Created March 23, 2018 08:23
Use cloudant node.js lib #cloudant
const Cloudant = require('@cloudant/cloudant')
const {
CLOUDANT_ACCOUNT,
CLOUDANT_DB,
CLOUDANT_KEY
CLOUDANT_PASSWORD
} = process.env
const cloudant = Cloudant({
@wmakeev
wmakeev / token-generator.js
Created April 1, 2018 14:58 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jwt');
@wmakeev
wmakeev / 01-my-module.js
Last active May 8, 2018 14:09
Module #saga #sync #module #vision
const { getContext } = require('some-task-lib')
const loadUser = require('./02-load-user_...')
module.exports = async function myModule (sandbox) {
// ??? standard context methods (context should implement interface described in common specification)
const context = getContext(sandbox)
const { on, off, once, emit, send, isUnicast, chain } = context
// ??? non standard methods, described in module manifest and binded to context
@wmakeev
wmakeev / README.md
Last active December 29, 2018 15:10
Digital camera control #canon #nikon #photo #gphoto #camera
@wmakeev
wmakeev / README.md
Created August 3, 2018 09:36
Пакетная выгрузка миниатюр RAW файлов на S3

Пакетная выгрузка миниатюр RAW файлов на S3

@wmakeev
wmakeev / 1.md
Last active November 20, 2022 07:31
Bash cheat sheet #bash #cli #cheatsheet #osx

Основные сочетания клавиш

Сочетание Описание Действие
CTRL+E перемещение курсора в конец строки
CTRL+A перемещение курсора в начало строки
Meta+F →␣ перемещение к следующему слову
Meta+B ␣← перемещение к предыдущему слову
CTRL+K ✂︎⇥ вырезать текст от курсора до конца строки
CTRL+U ⇤✂︎ вырезать текст от курсора до начала строки