Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home (during free time)

Flamur Kasa FKasa

View GitHub Profile
@FKasa
FKasa / sq-MK.ps
Last active Jan 10, 2019
sq-MK regional settings in 1 line
View sq-MK.ps
$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 Mar 5, 2018
Finds evil eval-s hidden in comments, whitespace or plain sight
View evil_finder.sh
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 Jun 29, 2017
PHP file database with collision prevention
View fair_split.php
$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 Feb 21, 2015
Git hotkeys for Sublime (commit and push)
View user_keymap
{ "keys": ["f1"], "command": "git_quick_commit" },
{ "keys": ["f5"], "command": "git_raw", "args": {"command": "git push", "args": {"may_change_files": false} } }
View designer.html
<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">
You can’t perform that action at this time.