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
/* eslint-disable func-names, no-extend-native */ | |
Promise.prototype.catch = function (...args) { | |
if (args.length === 0) { | |
throw new TypeError('0 arguments given'); | |
} | |
if (typeof args[args.length - 1] !== 'function') { | |
throw new TypeError('Last argument must be a function'); | |
} |
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 Discord = require('discord.js'); | |
const bot = new Discord.Client(); | |
var isReady = true; | |
async function sendAudio(connection, filepath) { | |
console.log('sendAudio'); | |
return new Promise((resolve, reject) => { | |
const dispatcher = connection.playFile(filepath); | |
dispatcher.on('end', () => { |
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 React, { Component } from 'react'; | |
import styled from 'styled-components'; | |
const orangeColor = '#FE6680'; | |
const bubbleSize = 50; | |
const stepperwidth = 800; | |
const StepContainer = styled.div` | |
width: ${stepperwidth}px; | |
height: ${bubbleSize}px; |
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 * as d3 from 'd3'; | |
const bgRGB = d3.rgb('#040404'); | |
const CANVAS_WIDTH = 1600; | |
const CANVAS_HEIGHT = 800; | |
const MIN_STAR_MAG = 6; | |
function getRetinaRatio(ctx) { | |
const devicePixelRatio = window.devicePixelRatio || 1; |
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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
OlderNewer