Skip to content

Instantly share code, notes, and snippets.

View mkdizajn's full-sized avatar
🐢
slow & thorough > faster & mistakable

Kresimir Pendic mkdizajn

🐢
slow & thorough > faster & mistakable
View GitHub Profile
@mkdizajn
mkdizajn / txt.txt
Created May 6, 2024 06:50
cert metrics terms
Required Information
Required Information
1
Program Policies & Agreements
Below are the Exam Terms and Conditions that are presented to all candidates during the exam registration process. During registration, candidates will click to accept all Exam Terms and Conditions.
No Shows, Cancellation, and Reschedule Policy
- If you do not show up for your exam, your exam fee is forfeited and you will not receive a refund.
@mkdizajn
mkdizajn / script.sh
Created March 23, 2024 16:36
BASH_ make items in subdirs flat in top dir
# >>>>>>>>>
# script to copy this structure - TO NEW DIRECTORY:
# slike1
# ├── 12063DSC04233.JPG
# ├── 27454DSC04230.JPG
# └── sub1
# ├── 15997DSC04140.JPG
# └── sub12
# └── 25022DSC04150.JPG
@mkdizajn
mkdizajn / theme.json
Created June 16, 2022 11:22 — forked from ryanwelcher/theme.json
When adding theme.json to an existing Classic Theme, these settings will stop the default color and typography controls from being enabled.
{
"$schema": "http://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"layout": {
"contentSize": "750px"
},
"color": {
"background": false,
"custom": false,
@mkdizajn
mkdizajn / emails.php
Created October 10, 2021 13:15 — forked from tameemsafi/emails.php
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {
@mkdizajn
mkdizajn / draggable-move-rotate-and-scale.markdown
Created April 13, 2021 13:51
Draggable Move, Rotate and Scale
@mkdizajn
mkdizajn / draggable-move-rotate-and-scale.markdown
Created April 13, 2021 13:50
Draggable Move, Rotate and Scale
@mkdizajn
mkdizajn / nginx.conf
Created January 30, 2021 22:34
nginx cache
#CACHE
set $condition '';
if ($request_method = POST){
set $condition "null";
}
if ($query_string) {
set $condition "null";
}
if ($http_cookie ~* (comment_author|comment_author_|wordpress_logged_in|wp_woocommerce_session)) {
set $condition "null";
@mkdizajn
mkdizajn / functions.php
Created January 25, 2021 00:04
visual composer to gutenberg converter (only image flex slider - to Guntenberg gallery and text => paragraph)
// attach that to everywhere
add_action( 'template_redirect', function (){
$w = new WP_Query( array(
'post__in' => array( 823, 817 ),
'post_type' => 'any' ,
// 'posts_per_page' => 100,
// 'offset' => 400
));
@mkdizajn
mkdizajn / gist:c46dd47124cdd5650323a0b4562b919a
Created October 25, 2020 00:21
little jquery popup on homepage - only first time - use localstorage to save
$(document).ready(function(e){
// local storage var
var ls = localStorage;
var now = new Date();
var old = ( ls.getItem( 'cachetime' ) ) ? new Date( JSON.parse ( ls.getItem( 'cachetime' ) ) ) : new Date( '2000' );
var dis = now - old;
var day = dis / (1000 * 60 * 60 * 24 ) ;
// show popup when EITHER:
// 1) popup never shown before (original first visit)
// 2) or if more then TIME passed after shown
@mkdizajn
mkdizajn / sql.sql
Created February 22, 2020 15:23
fix wordpress corupt tables -> this sql script reinit keys and indexes on all default WP tables
Script by https://wpindexfixer.tools.managedwphosting.nl
These are the queries for WP version 5.3.2
You need to replace wp_ with your site prefix — could be wp_ or something
-- Starting with wp_users
DELETE FROM wp_users WHERE ID = 0;
ALTER TABLE wp_users ADD PRIMARY KEY (ID);
ALTER TABLE wp_users ADD KEY user_login_key (user_login);