Skip to content

Instantly share code, notes, and snippets.

View daulex's full-sized avatar

Kirill Galenko daulex

View GitHub Profile
@daulex
daulex / backup.php
Created October 30, 2024 12:58
Create a database backup, add file changes to git, commit and push to remote (github)
<?php
// Paths and configurations
$repoPath = '/home/sites/37b/3/396f39af60/public_html';
$wpConfigPath = $repoPath . '/wp-config.php';
$dbBackupPath = $repoPath . '/backups/galenko.sql';
// Load database configuration from wp-config.php
$config = file_get_contents($wpConfigPath);
preg_match("/define\('DB_NAME', '(.+?)'\);/", $config, $dbNameMatch);
@daulex
daulex / select-reset.css
Created March 8, 2019 13:34
Reset css style for select Element!
select {
background: #fff;
border: 1px solid #eee;
border-radius: 3px;
padding: 3px 22px 3px 3px;
background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'%3E%3C/path%3E%3C/svg%3E");
background-position: calc(100% - 3px) 50%;
background-repeat: no-repeat;
background-size: 16px;
-webkit-appearance: none;