Skip to content

Instantly share code, notes, and snippets.

View Odepax's full-sized avatar
:shipit:
Edit this user's status

Odepax

:shipit:
Edit this user's status
View GitHub Profile
@Odepax
Odepax / diep-io-crosshair-cursor.js
Last active December 26, 2020 23:48
Diep.io crosshair cursor
// I use this to force the cursor to be a crosshair in diep.io as I think it's better for aiming than the arrow cursor.
// Just copy and paste this code snippet bellow in the browser console.
// The need for checking every 20s comes from the fact that the cursor is reset when hovering buttons (e.g. tank upgrade buttons).
// Cheking every 20s is quite smooth and does not decrease the game's performances.
// Alternatively, it's possible to opt for "move" instead of "crosshair" to get a fatter cross.
setInterval(function () {
if (document.getElementById("canvas").style.cursor != "crosshair")
document.getElementById("canvas").style.cursor = "crosshair"
}, 20000)
@Odepax
Odepax / firefox-image-pdf-2-png.js
Last active September 15, 2019 08:59
Page-basis PDF2PNG converter for Firefox.
// Note: the PDF must be image-based. Makes it not generic, but very usefull in some situations.
// Put this in the console:
// EXE: (function (pageId) { ... })("page3");
;(function(pageId = "page1") {
const canvas = document.getElementById(pageId)
const image = new Image()
image.src = canvas.toDataURL("image/png")
document.body.innerHTML = null