Skip to content

Instantly share code, notes, and snippets.

@tborychowski
tborychowski / img2datauri
Created November 29, 2021 11:14
JS :: convert image to data url with javascript
console.clear();
var img = new Image();
img.src = 'img/img.png';
img.onload = function () {
var canvas = document.createElement('canvas'), context = canvas.getContext('2d');
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0, img.width, img.height);
console.log(canvas.toDataURL('image/png'));
@tborychowski
tborychowski / global-protect.sh
Created October 16, 2023 12:43 — forked from kaleksandrov/global-protect.sh
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
$.each(State.stores, function(e,i) { State.stores[e] = 1000000000; })
OR
var high = 100000
var checkAll = setInterval(function() {
var bn = [
'attack',
'attack_bolas',
'attack_bone-spear',