Skip to content

Instantly share code, notes, and snippets.

View joviczarko's full-sized avatar
🎯
Focusing

Jović Žarko joviczarko

🎯
Focusing
View GitHub Profile
@joviczarko
joviczarko / mysql-backup.bat
Last active March 28, 2023 08:13
Automatic MySQL database backup (dump) bat file for wamp server
@ECHO OFF
For /f "tokens=2-4 delims=. " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-3 delims=.:," %%a in ("%TIME%") do (set mytime=%%a-%%b-%%c)
set TIMESTAMP=%mydate%_%mytime%
REM Export all databases into file E:\wamp64\backup\database_backup.[year][month][day].sql
"E:\wamp64\bin\mysql\mysql5.7.14\bin\mysqldump.exe" --all-databases --result-file="E:\wamp64\backup\database_backup_%TIMESTAMP%.sql" --user=root
REM Change working directory to the location of the DB dump file.
@joviczarko
joviczarko / url_upload.php
Last active May 14, 2022 15:54
Upload file from URL
<!DOCTYPE html>
<html>
<head>
<title>Upload file from URL</title>
<!-- From: https://stackoverflow.com/questions/22823204/is-there-any-way-to-upload-file-directly-from-url-in-filemanager-of-cpanel -->
</head>
<body>
<?php
$BASE_URL = strtok($_SERVER['REQUEST_URI'],'?');
Hash change of Bootstrap Tab
----------------------------
customized bootstrap tab component. here hash address will be changing on clicking on the tabs. and when ever copy this changed address to a browser url address accordingly it will show corresponding content in tabs
@joviczarko
joviczarko / function.php
Created November 19, 2020 00:11
Add countries as a custom taxonomy term
<?php
add_action('init', 'add_countries', 100);
function add_countries()
{
$country_array = array (
'AF' => 'Afghanistan',
'AX' => 'Åland Islands',
'AL' => 'Albania',
@joviczarko
joviczarko / page-subscribe.php
Created October 21, 2016 08:02
Sending form data to an API URL (Postman app helped to test API)
<?php
/*
Template Name: Subscribe Page
*/
get_header();
if( isset($_POST['subscriber_email']) ){
$api_url = 'http://API_URL';
$subscriber_name = $_POST['subscriber_name'];
@joviczarko
joviczarko / style.scss
Created September 10, 2020 14:01
Ordered list number
.ordered-numbers-list {
list-style: none;
counter-reset: order-counter;
li {
counter-increment: order-counter;
margin-bottom: 30px;
display:flex;
&::before {
content: counter(order-counter);
font-weight: bold;
@joviczarko
joviczarko / style.css
Last active May 13, 2020 23:12
Equal height of bootstrap 4 columns
.row.equalize {
display: flex;
flex-wrap: wrap;
}
.row.equalize > [class*="col-"] {
display: flex;
flex-direction: column;
}
@joviczarko
joviczarko / style.scss
Last active April 25, 2020 17:38
Five columns Bootstrap grid (BOOTSTRAP v4!) (Adding five column layout for bootstrap)
// *** Bootstrap five columns *** //
.col-5th {
flex: 0 0 20%;
max-width: 20%;
}
@include r("tablet") {
.col-sm-5th {
flex: 0 0 20%;
@joviczarko
joviczarko / style.css
Last active April 25, 2020 17:36
Five columns Bootstrap grid (BOOTSTRAP v3!) (Adding five column layout for bootstrap)
.col-xs-5ths,
.col-sm-5ths,
.col-md-5ths,
.col-lg-5ths {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
@joviczarko
joviczarko / mixins.scss
Last active April 25, 2020 16:32
Responsive utility (tweaked)
// Media query mixins
@mixin r($point) {
@if $point== "mobile" {
@media (max-width: 767px) {
@content;
}
}
@if $point==768 or $point== "tablet" {
@media (min-width: 768px) {
@content;