This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bootstrap 4 all media queries #wMQ | |
* https://getbootstrap.com/docs/4.5/layout/overview/ | |
* up > sm, md, lg, xl | |
* down < sm, md, lg | |
* only = xs, sm, lg, xl | |
* between <> sm-lg, sm-xl, md-xl | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- main.html (html input and js for open new window with elFinder for select file) --> | |
<input type="text" class="form-control" value="" id="idOfInput" onfocus="return openElFinder(event, 'idOfInput');"/> | |
<script> | |
$( document ).ready(function() { | |
window.input_id = ''; | |
window.openElFinder = function (event, input_id) { | |
event.preventDefault(); | |
window.single = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 - Before any rule check for mod-rewrite module existance and enable it | |
<IfModule mod_rewrite.c> | |
# Enable before other rules | |
RewriteEngine On | |
</IfModule> | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} (.+)/$ | |
RewriteRule ^ %1 [L,R=301] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// yo can follow this guide to http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token# | |
#1 first you need to create a Client in Instgram Developer Dashboard | |
// https://www.instagram.com/developer/clients/manage/ | |
#2 after you need to retrive a oAuth code for after get access_token | |
// https://www.instagram.com/developer/authentication/ | |
// change the params with your one and open link in browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$gallery_loop = false; | |
$the_content = get_the_content(); // all content | |
$galleries = []; //Create empty figures array that will hold all of our parsed HTML data | |
while ($gallery_loop) { | |
$gallery = $the_content; // <figure .. </figure> | |
//<!-- wp:gallery {"ids":[742,739,737],"linkTo":"none"} --> | |
$cut_from = '<!-- wp:gallery'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = $_SERVER["REQUEST_URI"]; | |
// clear all cache | |
if ($url == '/cache/clear-all') { | |
array_map('unlink', glob("cache/*.html")); | |
exit('Cache clear successfully!'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
In example make all images of website content (maybe insterted trough editor) | |
openable trough gallery | |
[this work with Blueimp Gallery https://github.com/blueimp/Gallery] | |
*/ | |
$(".auto-gallery-content").each(function(){ | |
var data_gallery = $(this).data("autoGallery") ? $(this).data("autoGallery") : "gallery"; | |
$("img", $(this)).each(function () { | |
if (!$(this).hasClass('no-auto-gallery')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Message to be displayed on unload | |
var message = $('#jtrnslt #leavemess').text(), submitting = false; | |
// On Form submition set submitting to true for not fire onbeforeunload | |
$(document).on("submit", "form", function(event){ | |
submitting = true; | |
}); | |
// Window onbeforeunload fired when leave page but not if it a form submition or element with .noBeforeUnload class | |
window.onbeforeunload = function (e) { | |
e = e || window.event; | |
// Determine if you want to allow unload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* withAlert() | |
* | |
* @dependencies [css: bootstrap(.alert), withstyle(.withAlert), jquery] | |
* | |
* @param string message | |
* @param string type warning|success|danger|primary|secondary|info | |
* @param object options {autohide: true/false, hidetime: 6000, placement: top|bottom} | |
*/ | |
function withAlert(message, type, options) { |
NewerOlder