from linux mint forum.
I solved this type of problems by
* giving ownership of /opt/lampp/htdocs folder and files to current user and group
* running xampp's apache httpd process under currrent user account
//from https://lukechannings.com/blog/2021-06-09-does-safari-15-fix-the-vh-bug/ | |
height:calc(100vh - env(safe-area-inset-bottom)); |
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
<?php | |
function get_my_posts($max=12,$paged=1,$with_category=[],$meta_fields=[],$ignore_cats=[],$ignore_posts=[]){ | |
$args = [ | |
//woocommerce product | |
//'post_type' => 'product', | |
'post_status' => 'publish', | |
//'ignore_sticky_posts' => 1, | |
'posts_per_page' => $max, | |
'paged' => $paged, |
const timeAgo = (unixtime)=>{ | |
//no weeks | |
const periods = ["second", "minute", "hour", "day", "month", "year", "decade"]; | |
const lengths = ["60","60","24","31","12","10"]; | |
//js returns in ms instead of s | |
const now = Math.round(Date.now() / 1000); | |
let difference = now - unixtime; | |
let j=0; | |
for(j = 0; difference >= lengths[j] && j < lengths.length-1; j++) { | |
difference = difference / lengths[j]; |
from linux mint forum.
I solved this type of problems by
* giving ownership of /opt/lampp/htdocs folder and files to current user and group
* running xampp's apache httpd process under currrent user account
# Disable directory browsing | |
Options All -Indexes | |
# Setup browser caching | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" |
<?php | |
/** | |
* Receives CSV string and returns as an array. | |
*/ | |
function csv_to_array($csv, $delimiter=',', $header_line=true) { | |
// CSV from external sources may have Unix or DOS line endings. str_getcsv() | |
// requires that the "delimiter" be one character only, so we don't want | |
// to pass the DOS line ending \r\n to that function. So first we ensure | |
// that we have Unix line endings only. | |
$csv = str_replace("\r\n", "\n", $csv); |
//asume all modals have class modal and are closed by removing the class open. | |
//close open modal on outside click | |
const clickOutSideModal = (e)=>{ | |
let current = e.target; | |
let insideModal = false; | |
while(current.parentNode && !insideModal && current.parentNode.tagName != 'BODY'){ | |
if(current.parentNode.classList.contains('modal')){ | |
insideModal = true; | |
} | |
current = current.parentNode; |
<?php | |
$categories = get_the_category(); | |
$tags = ""; | |
foreach ($categories as $key => $cat) { | |
$category_link = get_category_link($cat->cat_ID); | |
$tags .= '<a href="'.esc_url( $category_link ).'" title="'.esc_attr($cat->name).'">'.$cat->name.'</a>'; | |
if(isset($categories[$key+1])){ $tags .= ", "; } | |
} |