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
router.get('/:documentId/*', (req, res) => { | |
var documentId = req.params.documentId; | |
if(documentId){ | |
TelegramClient.getFileDetails(documentId).then((fileDetails) => { | |
var fileUrl = TelegramClient.getTelegramFileUrl(fileDetails.result.file_path); | |
request(fileUrl) | |
.on('response', (response) => { | |
if (response.statusCode === 200) { | |
res.writeHead(200, { | |
'Content-Type': response.headers['content-type'] |
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
var getGfycatUrlsForKeenList = (keenEntries) => { | |
var promises = keenEntries.map((entry) => { | |
return new Promise((resolve, reject) => { | |
GfycatClient.getGifycatLinkDetails(entry.reaction) | |
.then((gfycatDetails) => { | |
if(!gfycatDetails.mp4Url){ | |
} | |
resolve({ | |
title : entry.question, | |
documentId : entry.reaction, |
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
var uploadQueue | |
var addGifToUploadQueueWithDelay = (url) => { | |
var delayAndUpload = () => { | |
return delay().then(uploadGifToGfycat.bind(null, url)); | |
} | |
//Queue is either empty or finished | |
if(!uploadQueue || uploadQueue.isFulfilled()){ | |
uploadQueue = delayAndUpload(); |
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
import { Conversation } from 'chat-template'; | |
import ReactDOM from 'react-dom'; | |
import React from 'react'; | |
const showChatTemplate = (messages, element, delay = 1, height = 300) => { | |
ReactDOM.render(<Conversation delay={delay} height={height} messages={messages} />, | |
element); | |
}; | |
module.exports = showChatTemplate; |
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
Show hidden characters
{ | |
"presets": ["es2015", "stage-1", "stage-2", "react"] | |
} |
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
module.exports = { | |
entry: './wrapper.js', | |
output: { | |
libraryTarget: 'var', | |
library: 'showChatTemplate', | |
path: 'builds', | |
filename: 'chat-template.js', | |
}, | |
module: { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<base href="/"> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | |
<title>react-webpack-wrapper-example</title> |
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 webpack = require('webpack'); | |
module.exports = { | |
entry: './wrapper.js', | |
output: { | |
libraryTarget: 'var', | |
library: 'showChatTemplate', | |
path: 'builds', | |
filename: 'chat-template-min.js', | |
}, |
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
Create the backup.sh file and paste in contents of the file | |
Edit the crontab: crontab -e | |
30 2 * * * /root/backup.sh |
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
#include <Wire.h> | |
#define ttp229 (0xAF>>1) | |
uint16_t data_out = 0; | |
uint16_t data1, data2; | |
int count = 0; | |
boolean count2 = false; | |
// https://github.com/witnessmenow/BPLib | |
#include <BPLib.h> | |
#include <SoftwareSerial.h> |
OlderNewer