Skip to content

Instantly share code, notes, and snippets.

View iwanofski's full-sized avatar

Martin Iwanowski iwanofski

  • Stockholm
  • 02:22 (UTC +02:00)
View GitHub Profile
@iwanofski
iwanofski / resize-canvas.js
Created October 6, 2025 09:47
Resize HTMLCanvasElement without stretching
const canvas = document.createElement('canvas')
const observer = new ResizeObserver(onResize)
observer.observe(canvas)
function onResize () {
const rect = canvas.getBoundingClientRect()
// omitting dpr consideration
@iwanofski
iwanofski / index.js
Created April 15, 2024 14:07
Quickie leak test
const axios = require('axios')
const axiosRetry = require('axios-retry').default
const instance = axios.create({
auth: {
username: 'dev',
password: 'pass'
},
baseURL: 'http://localhost:8080'
})