Skip to content

Instantly share code, notes, and snippets.

@echo off
REM Minify JS CSS SVG
REM npm install uglify-js -g
REM or
REM npm install terser -g
REM npm install clean-css-cli -g
REM npm install svgo -g
@alexantr
alexantr / adminer.php
Created January 16, 2021 18:48
Adminer with password saving
<?php
// download latest from https://www.adminer.org/latest-mysql-en.php
$files = scandir(__DIR__, SCANDIR_SORT_DESCENDING);
foreach ($files as $file) {
if ($file != '.' && $file != '..' && is_file(__DIR__ . '/' . $file) && strpos($file, 'adminer-') === 0 && substr($file, -4) === '.php') {
$f = str_replace('-mysql', '', $file);
if (is_file(__DIR__ . '/' . $f)) {
require __DIR__ . '/' . $f;
break;
@alexantr
alexantr / dl_adminer.php
Created September 30, 2019 09:27
Download latest adminer: php dl_adminer.php
<?php
$url = 'https://www.adminer.org/latest-mysql-en.php';
$data = get_web_page($url);
if (isset($data['url'], $data['content'])) {
print_r($data['url']);
file_put_contents(basename($data['url']), $data['content']);
@alexantr
alexantr / mysql_backup.sh
Created November 9, 2018 08:54
Simple mysql backup with Yandex.Disk support.
#!/bin/bash
# save password for db user "backup" in "~/.mylogin.cnf":
# mysql_config_editor set --login-path=local --host=localhost --user=backup --password
# permisions for backup user: Select table data, Show databases, Lock tables, Show View
# Base folder with backups
BASE_BACKUP_DIR="$HOME/.backup"
# Current date for folder name