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 / foo.js
Created February 9, 2025 06:50
javascript fetch two reqs one pass header cookie to another
// Example of obtaining a cookie (typically from a login endpoint)
fetch('http://localhost/api/v1/chatbot/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({query: "hi - this is test one"})
//body: JSON.stringify({email: "[email protected]", password: "12345!abcABC"})
})
.then(response => {
@mkdizajn
mkdizajn / foo.js
Last active December 18, 2024 09:42
guten block shortcuts
// get editor meta
wp.data.select( 'core/editor').getEditedPostAttribute("meta");
// get editor blocks
wp.data.select( 'core/editor').getEditorBlocks();
@mkdizajn
mkdizajn / foo.txt
Created December 8, 2024 07:43
nextcloud
‎‎​
@mkdizajn
mkdizajn / foo.html
Created October 14, 2024 17:04
google forms submit form redirect to new thankyou page
<script type="text/javascript">var submitted=false;</script>
<iframe name="hidden_iframe" id="hidden_iframe" style="display:none;"
onload="if(submitted) {window.location='whateveryourredirectis.html';}"></iframe>
<form action="YOUR-EMBEDDED-GOOGLE-SPREADSHEET-LINK" method="post" target="hidden_iframe"
onsubmit="submitted=true;">
@mkdizajn
mkdizajn / index.js
Last active October 11, 2024 13:58
wordpress_multicategory
// level 1 cats
var c1 = ["Africa",
"Antarctica",
"Asia",
"Australasia",
"Caribbean",
"Central America",
"Europe",
"Indian Ocean",
"Middle East",
@mkdizajn
mkdizajn / css.css
Last active September 27, 2024 21:42
my css snipps
/* caping to min value - comma sep values - min */
.test{
margin-left: min(-16px, (100vw - 72ch) / -2);
}
/* full width from narrow parent */
.fullwidth{
width: 100dvw;
position: relative;
left: 50%;
<?php // example of old loop grid in classic theme
<div class="cf"></div>
<div class="dnevne-objave">
<?php query_posts( array ( 'category_name' => 'istaknuti', 'posts_per_page' => 12, 'paged' => $paged ) ); ?>
<?php while( $x <= 4 ) : the_post(); ?>
<div class="box <?php echo ( $x % 3 == 2 ) ? 'last' : ''; ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" class="pix"><?php the_post_thumbnail('dnevni', array('title' => '')); ?><div></div></a>
@mkdizajn
mkdizajn / index.htm
Last active June 26, 2024 07:39
wordpress CMS mass update X posts - and trigger btn submit, enable etc..
<h2>Run this in CMS .. somewhere create admin page with UL list of desired posts</h2>
<style>
ul,li{ list-style-type:none;margin:0;padding:0 }
iframe{width: 100%;min-height:32vh}
</style>
<ul style="grid-template-columns: repeat(4, minmax(0, 1fr));display: grid;">
<li><iframe id="sub0" src="/wp-admin/post.php?post=129681&action=edit"></iframe></li>
<li><iframe id="sub1" src="/wp-admin/post.php?post=129682&action=edit"></iframe></li>
<li><iframe id="sub2" src="/wp-admin/post.php?post=129683&action=edit"></iframe></li>
@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