Skip to content

Instantly share code, notes, and snippets.

View daviesesiro's full-sized avatar
🖖
Working from home

esiro daviesesiro

🖖
Working from home
View GitHub Profile
package main
import (
"bufio"
"fmt"
"log"
"math/rand"
"os"
"sort"
"strconv"
@daviesesiro
daviesesiro / image-resize.js
Last active June 27, 2024 01:05
a minimal function to resize an image on the browser in JavaScript
/**
* Resizes an Image File and converts it to a dataurl string.
* @param imageFile the image file (probably from a file input)
* @param resize_width The width you want the image to be
* @param quality quality of the resize image 0 - 1
*/
const resizeImage = ({
resizeWidth = 400,
imageFile,
quality = 1,
const express = require("express");
const { get } = require("axios").default;
const { randomBytes } = require("crypto");
const app = express();
app.use(express.json());
const CSVtoJson = (csvStr = "", selected = []) => {
var parsedRows = [];
var quote = false; // inside quotes?