Use Deno to download files from the internet.
deno run --allow-net --allow-write download.ts [url] [filename]
import { useMutation } from 'react-query'; | |
import fetch from 'isomorphic-unfetch'; | |
export default function useSearch({ endpoint } = {}) { | |
if (!endpoint) { | |
throw new Error("Must provide an endpoint to search"); | |
} | |
let expressionConfig = ""; |
import { Injectable } from '@angular/core'; | |
import * as AWS from 'aws-sdk/global'; | |
import * as S3 from 'aws-sdk/clients/s3'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export default class UploadService { | |
constructor() { } |
import * as React from "react"; | |
type ThemeConfig = "system" | "light" | "dark"; | |
type ThemeName = "light" | "dark"; | |
// Custom themes are keyed by a unique id. | |
type KeyedThemes = { | |
[k: string]: { | |
config: ThemeConfig; | |
themeName: ThemeName; | |
}; |
export default (function create(options = {}) { | |
const client = { | |
headers: options.headers || {}, | |
create | |
}; | |
const events = {}; | |
client.emit = (type, e) => { | |
events[type] && | |
events[type].slice().map(fn => { |
{"lastUpload":"2020-05-01T19:06:41.818Z","extensionVersion":"v3.4.3"} |
// Backend | |
import formidable from 'formidable'; | |
export const config = { | |
api: { | |
bodyParser: false, | |
}, | |
}; | |
export default async (req, res) => { |
const axios = require('axios'); | |
const apiurl = 'https://api.telegram.org/bot'; | |
const serveraddress = 'https://yourdomain.com'; | |
const tokens = ['3445345345:454545-iY_wE6wj_aKDJwKLXk', '453454545:gffgfgzbcfjhsdbflhjdsfvhjlvdsf']; | |
//set webhook | |
//you can make this as call as way you want. | |
webhookURL(tokens, 50, 8443, 'tgram'); | |
async function webhookURL(bot_tokens, max_connections, port, from) { |
import auth0 from '../../lib/Auth0/config'; | |
export default async function session(req, res) { | |
try { | |
// console.log(req); | |
const { accessToken } = await auth0.getSession(req); | |
if (accessToken) res.send(accessToken); | |
res.status(500).end(accessToken); | |
} catch (error) { |