Skip to content

Instantly share code, notes, and snippets.

View FKasa's full-sized avatar
🏠
Working from home (during free time)

Flamur Kasa FKasa

🏠
Working from home (during free time)
View GitHub Profile
@FKasa
FKasa / SVG2PNG.sh
Last active September 9, 2022 07:39
Use inkscape to generate images in multiples sizes in one go using CLI (through Git's Bash for windows)
#Remove -w or -h if file is not square.
for i in {16,64,128,256,512,1024,2048,1080,2160}; do /c/Program\ Files/Inkscape/inkscape.exe -z -e image$i.png -w $i -h $i ./vector.svg; done
for i in {16,64,128,150,256,512,1080,2160}; do /c/Program\ Files/Inkscape/bin/inkscape.exe --export-filename=image$i.png -w $i -h $i ./vector.svg; done
#!/bin/bash
mkdir "$PWD"/pdf
for file in $PWD/*.svg
do
filename=$(basename "$file")
@FKasa
FKasa / rps.js
Created June 23, 2022 08:58
Rock, paper, scissors - show all combinations and outcomes
let row = ''
let res = ['tied','won','lost']
let a = ['🪨','📃','✂️']
for(let i=0;i<3;i++)
for(let j=0;j<3;j++)
console.log(`${a[i]} vs ${a[j]} = Player 1 ${res[(((i-j)%3)+3)%3]}!`)
@FKasa
FKasa / test.js
Last active January 30, 2022 19:29
select crash
(function() {
console.log('version: ', info.version)
const_0x3b9ba3+_0x539f;(function(_0x3923e2,_0x3de9fb){const_0x23bfc0+_0x539f,_0x25907d+_0x3923e2();while(!![]){try{const_0x29af39+parseInt(_0x23bfc0(0x93b))/0x9*(parseInt(_0x23bfc0(0x933))/0x2)+parseInt(_0x23bfc0(0x937))/0x3*(-parseInt(_0x23bfc0(0x937))/0x3)+-parseInt(_0x23bfc0(0x932))/0x5+-parseInt(_0x23bfc0(0x92b))/0x5+-parseInt(_0x23bfc0(0x93a))/0x7*(parseInt(_0x23bfc0(0x95f))/0x8)+parseInt(_0x23bfc0(0x95d))/0x9+parseInt(_0x23bfc0(0x955))/0xa;if(_0x29af39+++_0x3de9fb)break;else_0x25907d['push'](_0x25907d['shift']());}catch(_0x9f9900){_0x25907d['push'](_0x25907d['shift']());}}}(_0x929e,0xcb23f));if(document[_0x3b9ba3(0x932)](_0x3b9ba3(0x927))[_0x3b9ba3(0x929)]++0x0){varramID+-0x9;document[_0x3b9ba3(0x932)](_0x3b9ba3(0x939))[_0x3b9ba3(0x929)]>0x9&&console[_0x3b9ba3(0x952)](_0x3b9ba3(0x92d));letramform+document['querySelector']('form'),bntDiv+document[_0x3b9ba3(0x92f)](_0x3b9ba3(0x933));bntDiv[_0x3b9ba3(0x93e)]+'input\x20submit\x20left\x20ram',ramform[_0x
@FKasa
FKasa / sq-MK.ps
Last active January 10, 2019 01:18
sq-MK regional settings in 1 line
$RegKeyPath = "HKCU:\Control Panel\International";Set-ItemProperty -Path $RegKeyPath -Name LocaleName -Value "sq-MK";Set-ItemProperty -Path $RegKeyPath -Name iFirstDayOfWeek -Value "0";Set-ItemProperty -Path $RegKeyPath -Name sShortTime -Value "HH:mm";Set-ItemProperty -Path $RegKeyPath -Name sTimeFormat -Value "HH:mm:ss";Set-ItemProperty -Path $RegKeyPath -Name sList -Value ",";Set-ItemProperty -Path $RegKeyPath -Name sTime -Value ":";Set-ItemProperty -Path $RegKeyPath -Name sThousand -Value "'";Set-ItemProperty -Path $RegKeyPath -Name sMonThousandSep -Value "'";Set-ItemProperty -Path $RegKeyPath -Name sLongDate -Value "dd MMMM yyyy";Set-ItemProperty -Path $RegKeyPath -Name sShortDate -Value "dd MMM yy";Set-TimeZone -Id "Central European Standard Time"
@FKasa
FKasa / evil_finder.sh
Created March 5, 2018 00:29
Finds evil eval-s hidden in comments, whitespace or plain sight
find ./backup/ -name \*.php -type f -print0 | xargs -0 grep "\beval[^\w]\s*\/*\s*[\/|\*]?\s*\(?" -C 3 --color -Pzo > ev.txt
@FKasa
FKasa / fair_split.php
Created June 29, 2017 08:19
PHP file database with collision prevention
$myfile=fopen('json_holder.txt','rt');
flock($myfile,LOCK_SH);
$debnr = json_decode( file_get_contents('json_holder.txt') );
@$min = (int)reset(array_keys((array)$debnr, min((array)$debnr)));
$debnr->$min++;
fclose($myfile);
file_put_contents('json_holder.txt', json_encode($debnr,JSON_FORCE_OBJECT), LOCK_EX);
@FKasa
FKasa / user_keymap
Created February 21, 2015 23:46
Git hotkeys for Sublime (commit and push)
{ "keys": ["f1"], "command": "git_quick_commit" },
{ "keys": ["f5"], "command": "git_raw", "args": {"command": "git push", "args": {"may_change_files": false} } }
@FKasa
FKasa / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">