var svg = "<svg height=\"512pt\" viewBox=\"0 0 512 512\" width=\"512pt\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m256 0c-141.164062 0-256 114.835938-256 256s114.835938 256 256 256 256-114.835938 256-256-114.835938-256-256-256zm0 0\" fill=\"#f44336\"/><path d=\"m341.332031 256c0 47.128906-38.203125 85.332031-85.332031 85.332031s-85.332031-38.203125-85.332031-85.332031 38.203125-85.332031 85.332031-85.332031 85.332031 38.203125 85.332031 85.332031zm0 0\" fill=\"#fafafa\"/><path d=\"m256 512c-141.164062 0-256-114.835938-256-256s114.835938-256 256-256 256 114.835938 256 256-114.835938 256-256 256zm0-480c-123.519531 0-224 100.480469-224 224s100.480469 224 224 224 224-100.480469 224-224-100.480469-224-224-224zm0 0\"/><path d=\"m256 362.667969c-58.816406 0-106.667969-47.851563-106.667969-106.667969s47.851563-106.667969 106.667969-106.667969 106.667969 47.851563 106.667969 106.667969-47.851563 106.667969-106.667969 106.667969zm0-181.335938c-41.171875 0-74.667969 33.496094-74.667969 74.667969s33.496094 74.667969 74.667969 74.667969 74.667969-33.496094 74.667969-74.667969-33.496094-74.667969-74.667969-74.667969zm0 0\"/></svg>";
var svgUrl = "data:image/svg+xml," + encodeURIComponent(svg);
var markerIcon = L.icon({
iconUrl: svgUrl,
iconSize: [22, 22],
iconAnchor: [11, 11],
popupAnchor: [0, -11],
shadowSize: false,
shadowAnchor: false,
});
new L.marker(new L.LatLng(52, 21), {icon: markerIcon})
.bindPopup(`popup`)
.addTo(map)
;
Doctrine debug executed sql queries
\Doctrine\DBAL\Connection::executeStatement
Close unresponsive, hanging ssh connection
press [ENTER]
then ~.
tylda and period
if normal things don’t work, and you can’t close ssh connection, first you should try:
[enter] and [CTRL] + [C]
typing: exit
Link Pictures directory into Dropbox account in Ubuntu / PopOs
to create Pictures link, move Pictures directory from your /home directory to dropbox directory and create link as described above
ln -s ~/Dropbox/backup/Pictures /home/u/Pictures
where `/u/` is name or your account
first argument of ln command is real location directory (from directory),
second argument is where link should be created (to / destination directory)
LibreOffice modify default margins
To change default page size in LibreOffice Writer
create empty document and set margins in Format / Page Style, save
Go to: File / Templates / Save As Template
Enter template name and select My Templates
Save
Go to: File / Templates / Manage Templates
Right click newly created template and set it as default.
JS, jQuery on input ENTER keypress submit form
$('.input').on('keypress', function (e) {
if (e.key !== 'Enter') {
return;
}
$(this).closest('form').submit();
});
PhpStorm Idea freezing, keyboard blocked
try to add following options to .vmoptions file, you can edit it by clicking in menu bar: Help / Edit Custom VM options
and adding following line
-Dawt.ime.disabled=true
this should help fixing freeze of UI in phpstorm and idea. By disabling processing of input information by Java Input Method Framework. By default it is done for compatibility with special keyboards and languages like Chinese and similar, so most likely you do not need it anyways.
Apache HTTPS by Let’s Encrypt tutorial
pause spotify ubuntu / linux after time
to pause spotify on ubuntu, linux after some time you can use following command
sleep 22m && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
replace `sleep 22m` wtih ammount of time you need, in this case 22 minutes, if you prefer seconds you can do that by using `sleep 30` to wait for 30 seconds
sleep 22m
sleep 30
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
mariadb order by results in group by trick
new mariadb optimizes subqueries, which prevents using trick to get required row when grouping by multiple rows, and you need specific row to show after applying group by
when using queries like:
SELECT * FROM (
SELECT ... FROM table ORDER BY column DESC
)
GROUP BY some_field
to fix that, before this query set following option:
SET SESSION optimizer_switch='derived_merge=off';
this would allow sorting group by query by required column, and in turn provide us witch correct results