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
const fs = require('fs'); | |
const os = require('os'); | |
const tunnelSsh = require('tunnel-ssh'); | |
const { Pool } = require('pg'); | |
(async () => { | |
/** @type {import('net').Server} */ | |
let tunnel; | |
try { |
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const {Buffer} = require('buffer'); | |
const filepath = process.argv[2]; | |
if (!filepath) { | |
console.log('\nДолжен быть указан путь к существующему файлу!\n'); | |
process.exit(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
const winax = require('winax'); | |
const sbrf = new winax.Object('SBRFSRV.Server'); | |
let opResultCode; | |
const opPinpadCheckResultCode = sbrf.NFun(7003); | |
console.log(opPinpadCheckResultCode, opPinpadCheckResultCode === 0 ? 'пинпад есть' : 'пинпада нет'); | |
sbrf.clear(); | |
// контрольная лента | |
console.info('[контрольная лента]'); |
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
package Example::TT2::M; | |
use strict; | |
use warnings; | |
use base 'Template::Plugin'; | |
use Locale::CLDR; | |
use Scalar::Util qw/looks_like_number/; | |
sub new { |
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
// @ts-check | |
const fs = require('fs'); | |
const client = require("jsreport-client")("http://localhost:5488"); | |
const { finished } = require('stream'); | |
(async () => { | |
try { | |
const data = { | |
"customer": "Тратата через атом!!", |
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
#!/usr/bin/env node | |
// @ts-check | |
const https = require('https'); | |
const { finished } = require('stream'); | |
load_rss_feed_titles('https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en') | |
.then(console.log).catch(console.error); | |
load_rss_feed_titles('https://news.google.com/rss?hl=ru&gl=RU&ceid=RU:ru') | |
.then(console.log).catch(console.error); |
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 possibleSums(coins, quantity) { | |
let arr = new Set(); | |
for (let i = 0, clen = coins.length; i < clen; i++) { | |
const coin = coins[i]; | |
const qty = quantity[i]; | |
const curr_sums = Array.from(arr); | |
const curr_coins = new Array(qty).fill().map((undefined, idx) => { | |
const n = coin * (idx + 1); | |
arr.add(n); | |
return n; |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "Passkit Web Service", | |
"contact": { | |
"name": "Clemens Krack", | |
"email": "info@clemenskrack.com" | |
}, | |
"version": "1.0.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
const values = [1,2,null,3].map((x) => !!x || null); | |
const vlength = values.length; | |
let combinations = []; | |
for (let i = 0; i < vlength; i++) { | |
if (values[i]) { | |
let acc = []; | |
acc.push(new Array(vlength).fill(null).fill(true, i, i + 1)); | |
for (let j = vlength - 1; j > i; j--) { | |
if (values[j]) { | |
acc = acc.concat( |
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
const fs = require('fs'); | |
const path = require('path'); | |
const testfile = path.join(path.resolve(), 'test.txt'); | |
read(testfile); | |
async function read(filepath) { | |
const rstream = fs.createReadStream(filepath, {highWaterMark: 70, encoding: 'utf-8'}); | |
let data; |
NewerOlder