A gist for VS Code to replace *italic* notation in markdown with _italic_ notation
Regex to match:
(?<!\*)\*(?!\*|\s)(.+?)(?<!\s|\*)\*(?!\*)
Regex to substitute:
_$1_
<?php | |
function transliterate_to_lower($string) | |
{ | |
$cyr = ['а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п', 'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я']; | |
$lat = ['a','b','v','g','d','e','e','zh','z','i','j','k','l','m','n','o','p','r','s','t','u','f','h','c','ch','sh','sh','','y','','e','yu','ya']; | |
$strlat = str_replace($cyr, $lat, mb_strtolower($string)); | |
return $strlat; | |
} | |
echo transliterate_to_lower("Привет, 1-й ёжик!"); |
<?php | |
function slugify($string) { | |
$string = transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();", $string); | |
$string = preg_replace('/[-\s]+/', '-', $string); | |
return trim($string, '-'); | |
} | |
echo slugify("Hello Wörld! Καλημέρα. Привет, 1-й ёжик!. 富士山. 國語"); | |
?> |
A gist for VS Code to replace *italic* notation in markdown with _italic_ notation
Regex to match:
(?<!\*)\*(?!\*|\s)(.+?)(?<!\s|\*)\*(?!\*)
Regex to substitute:
_$1_
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Copy Header Anchor</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> | |
</head> | |
<body> | |
<div class="section"> | |
<h1 id="section1">Section 1</h1> |
<?php | |
function TableOfContents($depth) | |
{ | |
$html_string = Articles_Detail('All'); | |
//get the headings down to the specified depth | |
$pattern = '/<h[2-'.$depth.']+ id=".+"[^>]*>.*?<\/h[2-'.$depth.']>/'; | |
$whocares = preg_match_all($pattern,$html_string,$winners); | |
//reformat the results to be more usable |
(.*[а-яА-ЯёЁ]+.*)+ |
(function () | |
{ | |
'use strict'; | |
if (!confirm('Удалить все заметки со стены?')) return; | |
var deletePostLink = document.body.querySelectorAll('a.delete-stub_cancel'); | |
for (var i = 0; i < deletePostLink.length; i++) | |
{ | |
deletePostLink[i].click(); | |
} | |
alert( 'удалено записей:'+deletePostLink.length); |