Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@blurymind
blurymind / bytesToSize.js
Created September 10, 2024 22:09 — forked from lanqy/bytesToSize.js
JavaScript To Convert Bytes To MB, KB, Etc
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i == 0) return bytes + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};
const getBase64StringSizeInbites = string => {
@blurymind
blurymind / kaplay-dist.js
Last active September 13, 2024 19:28
upload data from api
"use strict";var kaplay=(()=>{var bn=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var qa=Object.getOwnPropertyNames;var za=Object.prototype.hasOwnProperty;var i=(t,e)=>bn(t,"name",{value:e,configurable:!0});var Ya=(t,e)=>{for(var n in e)bn(t,n,{get:e[n],enumerable:!0})},Wa=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of qa(e))!za.call(t,o)&&o!==n&&bn(t,o,{get:()=>e[o],enumerable:!(r=Ha(e,o))||r.enumerable});return t};var $a=t=>Wa(bn({},"__esModule",{value:!0}),t);var ao=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return n=>{for(var r=n.length,o=new Uint8Array((r-(n[r-1]=="=")-(n[r-2]=="="))*3/4|0),s=0,a=0;s<r;){var l=t[n.charCodeAt(s++)],u=t[n.charCodeAt(s++)],m=t[n.charCodeAt(s++)],c=t[n.charCodeAt(s++)];o[a++]=l<<2|u>>4,o[a++]=u<<4|m>>2,o[a++]=m<<6|c}return o}})();var Yu={};Ya(Yu,{default:()=>zu});var H=class t{static{i(this,"Color")}r=255;g=255;b=255;constructor(e,n,r){this.r=Be(e,0,255),this.g=Be(n,0,255),this.b=Be(r,0,
@blurymind
blurymind / Deck ui.md
Created January 11, 2024 16:11 — forked from red-dragon65/Deck ui.md
How to properly run Steam Decks UI on Manjaro

This guide is deprecated! Please take a look at the defacto un-official SteamOS project HoloISO.

HoloISO is more straightforward to install and is being actively worked on.


Running Steams Deck UI on Manjaro with Minimal Glitches

This is an unofficial short guide on running Steam Decks new UI on Manjaro. I am kind of a linux noob, so forgive me if I get a few things wrong in this guide. Also, I have not fully tested everything so there may be some weird issues that I have overlooked.

@blurymind
blurymind / gist:c1e912cd2e71b194c6859b4c2dc75035
Created June 25, 2023 14:51
Bearpaw 2400 plus scanner HP
http://meier-geinitz.de/sane/gt68xx-backend/
BearPaw 2400 CU Plus
Install simple-scan and sane
copy these two files to /usr/share/sane/gt68xx
scan :)
@blurymind
blurymind / script.js
Created April 18, 2023 17:29 — forked from MichaelPHolstein/script.js
JavaScript file of background removal using Tensorflow and bodyPix
IMAGE_SRC = './img/8.jpg'
const loadImage = () => {
const img = new Image()
img.src = IMAGE_SRC
const canvas = document.querySelector('canvas')
const ctx = canvas.getContext('2d')
img.addEventListener('load', () => {
@blurymind
blurymind / remove-alpha-on-canvas.js
Created December 8, 2022 10:15 — forked from redblobgames/remove-alpha-on-canvas.js
Remove alpha channel on a canvas, so it's always transparent or always opaque
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const pixels = imageData.data;
for (let i = 3, n = canvas.width * canvas.height * 4; i < n; i += 4) {
pixels[i] = pixels[i] < 127? 0 : 255
}
ctx.putImageData(imageData, 0, 0);
@blurymind
blurymind / combinePdfs.sh
Created November 19, 2022 14:45
combinePdfs.sh
#!/bin/sh
# thunar file custom action /home/fox/INSTALL/combinePdfs.sh %F
# %F is full path to all selected files
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="${1%.pdf}-combined.pdf" "$@"
notify-send "created ${1%.pdf}-combined.pdf file"
@blurymind
blurymind / bbcodeTags.yarn
Last active September 13, 2024 19:49
Demo yarn files
title: Start
tags:
colorID: 0
position: 150,211
---
[b]Bold[/b] text
[u]Underlined[/u] text
Text in [i]italics[/i]
Text in [color=#ff0000]red color[/color] and [color=#0000ff]blue color[/color]
[color=#00ff00][b]Green and bold[/b][/color] text
@blurymind
blurymind / moveFilesOutOfFolders.sh
Last active June 13, 2022 12:43
moveFilesOutOfFolders.sh
#!/bin/sh
# fix for folders/files with spaces in them (ln13)
OLDIFS=$IFS
IFS=$'\n'
# thunar folder custom action /home/fox/INSTALL/deleteSmallSizeSubFolders.sh %F
# %F is full path to all selected folders
for var in "$@"
do
@blurymind
blurymind / deleteSmallSizeSubFolders.sh
Last active June 13, 2022 12:39
deleteSmallSizeSubFolders.sh
#!/bin/sh
# fix for folders/files with spaces in them (ln13)
OLDIFS=$IFS
IFS=$'\n'
# thunar folder custom action /home/fox/INSTALL/deleteSmallSizeSubFolders.sh %F
# %F is full path to all selected folders
for var in "$@"
do