This file contains hidden or 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 Telegraf = require('telegraf') | |
| const bot = new Telegraf(process.env.BOT_TOKEN) | |
| const spam_suspect = new Map(); | |
| bot.on('message', async (ctx) => { | |
| let chat_id = ctx.update.message.chat.id; | |
| let msg = ctx.update.message.text; | |
| let msg_id = ctx.update.message.message_id | |
| console.log(ctx.update.message.from) |
This file contains hidden or 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 outputResult(outData) { | |
| var row = createRowCopy(rmi.size()); | |
| for ( var uCol in outData) { | |
| var valIdx = rmi.indexOfValue(uCol); | |
| if (valIdx >= 0) { | |
| row[valIdx] = outData[uCol]; | |
| } | |
| } | |
| putRow(row); | |
| } |
This file contains hidden or 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
| // input can be CSV in Text, File, anything | |
| def getLHMapFromCSV(fis) { | |
| def data = fis.readLines() | |
| def headers = data.take(1)[0].split(',').collect{it.trim().toLowerCase()}.withIndex(0).collectEntries{i,p -> [(p):i]} | |
| data.drop(1).collect{it.split(',').collect{it}.withIndex(0).collectEntries{i,p -> [(headers[p]):i]}} | |
| } |
This file contains hidden or 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
| // @flow | |
| import { Readable } from 'stream'; | |
| import net from 'net'; | |
| export default class RequestStream extends Readable { | |
| socket: net.Socket; | |
| buffer: Buffer; | |
| httpTerm: Buffer; |