Skip to content

Instantly share code, notes, and snippets.

View gelevanog's full-sized avatar
🎯
Focusing

Ivan Savchenko gelevanog

🎯
Focusing
  • RIVIS
View GitHub Profile
@erkie
erkie / background.html
Created May 19, 2012 09:43
Save parts of screen using Chrome extension
<script>
var Constants = {
saveURL: 'http://random/birthday/saveimage.php',
w: 500,
h: 500,
x: 200,
y: 200
};
@remy
remy / trim-canvas.js
Last active January 1, 2026 09:46
Trims the surrounding transparent pixels from a canvas
// MIT http://rem.mit-license.org
function trim(c) {
var ctx = c.getContext('2d'),
copy = document.createElement('canvas').getContext('2d'),
pixels = ctx.getImageData(0, 0, c.width, c.height),
l = pixels.data.length,
i,
bound = {
top: null,