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
export async function batchOperation<T>(items: T[], operation: (items: T[], index: number) => Promise<void>, batchSize = 1000) { | |
let continueOperation = true; | |
let cursor = 0; | |
let successOperations = 0; | |
let erroredOperations = 0; | |
while (continueOperation) { | |
const batch = items.slice(cursor, cursor + batchSize); | |
if (batch.length) { |
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
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
/* 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 Tesseract = require('tesseract.js'); | |
const sharp = require('sharp'); | |
const cv = require('opencv4nodejs'); | |
const fs = require('fs'); | |
const EROSION_SIZE = 1; | |
const EROSION_MODE = cv.MORPH_ERODE; | |
const SCALE = 2; | |
const ITERATIONS = 2; | |
const ANCHOR = new cv.Point2(EROSION_SIZE, EROSION_SIZE); |
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
#include <Adafruit_NeoPixel.h> | |
#include <LedControlMS.h> | |
// Serial | |
#define BAUDRATE 115200 | |
// NeoPixel Stick | |
#define NP_PIN 6 | |
#define NUM_LEDS 16 | |
#define NEO_MAX_BRIGHTNESS 32 |
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 axios from 'axios'; | |
import {newNotification} from 'actions/notifications'; | |
import filterAxiosProps from './filter-axios-props'; | |
export const FETCH_API_ERROR = 'FETCH_API_ERROR'; | |
export const FETCH_API = 'FETCH_API'; | |
function checkIfItIsFunction(notification, response) { | |
if (typeof notification === 'function') { | |
return notification(response); |
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
FROM ubuntu:16.04 | |
ENV TSV=3.0.13.8 | |
RUN DEBIAN_FRONTEND=noninteractive \ | |
apt-get -y update && \ | |
apt-get -y install bzip2 && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | |
apt-get autoremove -y && \ | |
apt-get clean |
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
USERNAME | |
REGION | |
SEASON | |
killDeathRatio | |
winRatio | |
roundsPlayed | |
wins | |
losses | |
top10s |
NewerOlder